.settings
/.dist-buildwrapper
toolchain/*
+/build
--- /dev/null
+/*
+ * Copyright (c) 2008, ETH Zurich. All rights reserved.
+ *
+ * This file is distributed under the terms in the attached LICENSE file.
+ * If you do not find this file, copies can be found by writing to:
+ * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
+ */
+
+/*
+ * e1000.dev
+ *
+ * DESCRIPTION: Intel e1000 family Gigabit Ethernet NICs
+ *
+ * Numbers in comments refer to the Intel PCIe GbE Controllers Open
+ * Source Software Development Manual, 631xESB / 632xESB, 82563EB /
+ * 82564EB, 82571EB / 82572EI & 82573E / 82573V / 82573L.
+ * 316080-003, Revison 1.2, September 2007
+ */
+
+device e1000 lsbfirst ( addr base ) "Intel e1000 Gigabit Ethernet" {
+
+ /************************************
+ * General registers
+ ***********************************/
+
+ // 13.3.1
+ constants linkspeed "Link speed" {
+ mb10 = 0b00 "10Mb/s";
+ mb100 = 0b01 "100Mb/s";
+ mb1000 = 0b10 "1Gb/s";
+ mb_notused = 0b11 "1Gb/s";
+ };
+
+ register ctrl rw addr(base, 0x0000) "Device control" {
+ fd 1 "full-duplex";
+ _ 1 mbz;
+ gio_md 1 "GIO master disable";
+ lrst 1 "Link reset";
+ _ 1 mbz;
+ asde 1 "Auto-Speed Detection Enable";
+ slu 1 "Set link up";
+ ilos 1 "Invert Loss-of-Signal (LOS)";
+ speed 2 type(linkspeed) "Speed selection";
+ _ 1 mbz;
+ frcspd 1 "Force speed";
+ frcdplx 1 "Force duplex";
+ _ 5 mbz;
+ sdp0_data 1 "SDP0 data value, or dock/undock status";
+ sdp1_data 1 "SDP1 data value";
+ advd3wuc 1 "D3cold wakeup capability";
+ en_phy_pwr_mgmt 1 "PHY Power-Management Enable";
+ sdp0_iodir 1 "SDP0 pin I/O directionality";
+ sdp1_iodir 1 "SDP1 pin I/O directionality";
+ _ 2 mbz;
+ rst 1 "Device reset";
+ rfce 1 "Receive flow control enable";
+ tfce 1 "Transmit flow control enable";
+ _ 1 mbz;
+ vme 1 "VLAN mode enable";
+ phy_rst 1 "PHY reset";
+ };
+
+ // 82546 rev 3
+ register ctrldup rw addr(base, 0x0004) "Device Control Duplicate (Shadow)" {
+ fd 1 "full-duplex";
+ _ 1 mbz;
+ gio_md 1 "GIO master disable";
+ lrst 1 "Link reset";
+ _ 1 mbz;
+ asde 1 "Auto-Speed Detection Enable";
+ slu 1 "Set link up";
+ ilos 1 "Invert Loss-of-Signal (LOS)";
+ speed 2 type(linkspeed) "Speed selection";
+ _ 1 mbz;
+ frcspd 1 "Force speed";
+ frcdplx 1 "Force duplex";
+ _ 5 mbz;
+ sdp0_data 1 "SDP0 data value, or dock/undock status";
+ sdp1_data 1 "SDP1 data value";
+ advd3wuc 1 "D3cold wakeup capability";
+ en_phy_pwr_mgmt 1 "PHY Power-Management Enable";
+ sdp0_iodir 1 "SDP0 pin I/O directionality";
+ sdp1_iodir 1 "SDP1 pin I/O directionality";
+ _ 2 mbz;
+ rst 1 "Device reset";
+ rfce 1 "Receive flow control enable";
+ tfce 1 "Transmit flow control enable";
+ _ 1 mbz;
+ vme 1 "VLAN mode enable";
+ phy_rst 1 "PHY reset";
+ };
+
+ constants lanid "LAN ID" {
+ lan_a = 0b00 "LAN A";
+ lan_b = 0b01 "LAN B";
+ lan_not_u1 = 0b10 "LAN ID not used";
+ lan_not_u2 = 0b11 "LAN ID not used";
+ };
+ constants mac_mask "LAN MAC MASK" {
+ lan_b_mask = 0x0100 "LAN B mask";
+ };
+
+ // 13.3.2
+ register status ro addr(base, 0x0008) "Device status" {
+ fd 1 "Link full duplex configuration";
+ lu 1 "Link up";
+ func_id 2 "Function ID";
+ txoff 1 "Transmission paused";
+ tbimode 1 "TBI mode";
+ speed 2 type(linkspeed) "Link speed setting";
+ asdv 2 type(linkspeed) "Auto speed detection value";
+ phyra 1 "PHY reset asserted";
+ pci66 1 "PCI Bus speed indication";
+ bus64 1 "PCI Bus Width indication";
+ pcix_mode 1 "PCI-X Mode indication";
+ pcixspd 2 "PCI-X Bus Speed Indication";
+ _ 3 mbz;
+ gio_mes 1 "GIO master enable status";
+ _ 12 mbz;
+ };
+
+ // 13.3.3
+ constants flashenable "Flash write enable control" {
+ flash_erase = 0b00 "Flash erase";
+ flash_wr_disable = 0b01 "Flash writes discarded";
+ flash_wr_enable = 0b10 "Flash writed enabled";
+ };
+
+ constants eeaddrsize "EEPROM address size" {
+ bits8or9 = 0 "8- and 9-bit";
+ bits16 = 1 "16-bit";
+ };
+
+ constants nvmtype "Non-volatile memory type" {
+ eeprom = 0b00 "EEPROM";
+ saflash = 0b01 "Stand-alone Flash";
+ spiflash = 0b10 "Shared SPI Flash";
+ sio = 0b11 "SIO";
+ };
+
+ register eecd rw addr(base, 0x0010) "EEPROM/Flash control" {
+ ee_sk 1 "Clock input to EEPROM";
+ ee_cs 1 "Chip select to EEPROM";
+ ee_di 1 "Data input to EEPROM";
+ ee_do 1 "Data output bit from EEPROM";
+ fwe 2 type(flashenable) "Flash write enable control";
+ ee_req 1 "Request EEPROM access";
+ ee_gnt 1 "Grant EEPROM access";
+ ee_pres 1 "EEPROM present";
+ ee_size_n 1 "EEPROM size for NM93C46 compatible EEPROM" ;
+ ee_size_m 1 "EEPROM size for Microwire EEPROMs";
+ _ 2 mbz;
+ ee_type 1 "EEPROM Type. (82541xx and 82547GI/EI)";
+ _ 18 mbz;
+ };
+
+ // 13.3.4
+ // NM93C46 compatible EEPROMs
+ register eerd_nm rw addr(base, 0x0014) "EEPROM read" {
+ start 1 "Start read";
+ _ 3 mbz;
+ done 1 ro "Read done";
+ _ 3 mbz;
+ addr 8 "Read address";
+ data 16 "Read data";
+ };
+
+ register eerd_ms rw also addr(base, 0x0014) "EEPROM read 82541xx and 82547GI/EI" {
+ start 1 "Start read";
+ done 1 ro "Read done";
+ addr 14 "Read address";
+ data 16 "Read data";
+ };
+
+
+ // 13.3.5
+ constants linkmode "Link mode" {
+ glci = 0b00 "Direct coper or GLCI";
+ l82573 = 0b10 "Must be set for 82573E/V/L";
+ serdes = 0b11 "Internal SerDes (TBI) or SerDes mode";
+ };
+ register ctrlext rw addr(base, 0x0018) "Extended device control" {
+ _ 2 mbz;
+ sdp2_gpien 1 "General-purpose interrupt detection for SDP2";
+ sdp3_gpien 1 "General-purpose interrupt detection for SDP3";
+ _ 2;
+ sdp2_data 1 "SDP2 data value";
+ sdp3_data 1 "SDP3 data value";
+ _ 2 mbz;
+ sdp2_iodir 1 "SDP2 pin directionality";
+ sdp3_iodir 1 "SDP3 pin directionality";
+ asdchk 1 "Auto-speed-detection check";
+ ee_rst 1 "EEPROM reset";
+ _ 1 mbz;
+ spd_byps 1 "Speed select bypass";
+ _ 1;
+ rodis 1 "Relaxed ordering disabled";
+ serdeslpe 1 "SERDES low power enable";
+ dmadge 1 "DMA dynamic gating enable";
+ phypde 1 "PHY power down enable";
+ _ 1;
+ link_mode 2 type(linkmode) "Link mode";
+ pb_paren 1 "Packet buffer parity error detection enable";
+ df_paren 1 "Descriptor FIFO parity error detection enable";
+ _ 1 mbz;
+ iame 1 "Interrupt acknowledge auto-mask enable";
+ drv_load 1 "Driver loaded";
+ int_tca 1 "Timers clear enable";
+ host_paren 1 "Host data FIFO parity enable";
+ _ 1;
+ };
+
+ // 13.3.6
+ register fla rw addr(base, 0x001c) "Flash access" {
+ fl_sk 1 "Clock input to Flash";
+ fl_ce 1 "Chip select to Flash";
+ fl_si 1 "Data input to Flash";
+ fl_so 1 "Data output bit from Flash";
+ fl_req 1 "Request Flash access";
+ fl_gnt 1 "Grant Flash access";
+ fl_addr_sz 1 "Flash address size";
+ _ 2;
+ sw_wr_done 1 "Last write done";
+ rd_status 1 "Flash status";
+ _ 5;
+ ide_bo 14 "Base address of IDE Boot expansion ROM";
+ fl_busy 1 "Flash busy";
+ fl_er 1 "Flash erase command";
+ };
+
+ // 13.3.7
+ constants phyop "PHY register opcode" {
+ mdi_write = 0b01 "MDI Write";
+ mdi_read = 0b10 "MDI Read";
+ };
+ register mdic rw addr(base, 0x0020) "MDI control" {
+ data 16 "Data";
+ regadd 5 "PHY register address";
+ phyadd 5 "PHY address";
+ op 2 type(phyop) "Opcode";
+ r 1 "Ready bit";
+ i 1 "Interript enable";
+ e 1 "Error";
+ _ 1 mbz;
+ };
+
+ // 13.3.8
+ // There are a lot of PHY registers, all accessed through the MDIC.
+ // We don't yet list them here.
+
+ // 13.3.10
+ register serdesctl rw addr(base, 0x0024) "SERDES ANA" {
+ data 8 "Data to SerDes";
+ addr 8 "Address to SerDes";
+ _ 15;
+ done 1 "Done";
+ };
+
+ // 13.3.11-12
+ constants fca "Flow control address" {
+ fca_lo = 0x0c28001;
+ fca_hi = 0x0000100;
+ };
+ register fcal rw addr(base, 0x0028) "Flow control address low" type(uint32);
+ register fcah rw addr(base, 0x002C) "Flow control address low" type(uint32);
+
+ // 13.3.13
+ constants fctval "Flow control type" {
+ fct_val = 0x0008808;
+ };
+ register fct rw addr(base, 0x0030) "Flow control type" type(uint32);
+
+ // 13.3.14
+ register kumctrlsta rw addr(base, 0x0034) "GLCI control and status" {
+ data 16 "Data";
+ offset 5 "Offset of internal register";
+ ren 1 "Read enable (1=read)";
+ _ 10;
+ };
+
+ // 13.3.15
+ constants vet_val "VLAN ether type value" {
+ vlan_type = 0x0008100;
+ };
+ register vet rw addr(base, 0x0038) "VLAN Ether type" type(uint32);
+
+ // 13.3.16
+ register mdphya rw addr(base, 0x003c) "MDC/MDIO PHY address" {
+ phya 5 "PHY address";
+ _ 27;
+ };
+
+ // 13.3.17
+ register ufuse3 ro addr(base, 0x00f0) "ULT Fuse register 3" {
+ drred 15 "Data RAM redundancy fuses";
+ crred 13 "Code RAM redundancy fuses";
+ enad 1 "Enable Data RAM redundancy fuses";
+ enac 1 "Enable Code RAM redundancy fuses";
+ _ 2;
+ };
+
+ // 13.3.18
+ register fcttv rw addr(base, 0x0170) "Flow control transmit timer value" {
+ ttv 16 "Transmit timer value";
+ _ 16 mbz;
+ };
+
+ // 13.3.19
+ register txcw rw addr(base, 0x0178) "Transmit config word" {
+ _ 5 mbz;
+ txcw_fd 1 "TXCW full-duplex";
+ txcw_hd 1 "TXCW half-duplex";
+ txcw_pause 2 "TXCW pause";
+ _ 3 mbz;
+ txcw_rfi 2 "TXCW remote fault indication";
+ _ 1 mbz;
+ txcw_npr 1 "TXCW next page request";
+ _ 14 mbz;
+ txconfig 1 "Transmit config control bit";
+ ane 1 "Auto-negotiation enable";
+ };
+
+ // 13.3.20
+ register rxcw ro addr(base, 0x0180) "Receive config word" {
+ _ 5 mbz;
+ rxcw_fd 1 "RXCW full-duplex";
+ rxcw_hd 1 "RXCW half-duplex";
+ rxcw_pause 2 "RXCW pause";
+ _ 3 mbz;
+ rxcw_rfi 2 "RXCW remote fault indication";
+ _ 1 mbz;
+ rxcw_npr 1 "RXCW next page request";
+ _ 10 mbz;
+ nc 1 "Carrier sense indicator";
+ inv 1 "Invalid symbol during config process";
+ chg 1 "Change to RXCW indication";
+ rxconfig 1 "Reception indication";
+ sync 1 "Lost bit sync indication";
+ anc 1 "Auto-negotiation complete";
+ };
+
+ // 13.3.21
+ constants ledmode "LED output mode" {
+ link_10_100 = 0b0000 "Either 10 or 100 Mbs link established";
+ link_100_1000 = 0b0001 "Either 100 or 1000 Mbs link established";
+ link_up = 0b0010 "Any speed link established";
+ filter_activity = 0b0011 "Packets passing MAC filtering";
+ link_activity = 0b0100 "No transmit or receive activity";
+ link_10 = 0b0101 "10 Mbs link established";
+ link_100 = 0b0110 "100 Mbs link established";
+ link_1000 = 0b0111 "1000 Mbs link established";
+ full_duplex = 0b1001 "Link configured for full-duplex";
+ collision = 0b1010 "Collision is observed";
+ activity = 0b1011 "Link established and packets sent or revd";
+ bus_size = 0b1100 "Controller detects 1 PCIe lane conn.";
+ paused = 0b1101 "Transmitter is flow controlled";
+ led_on = 0b1110 "Always on";
+ led_off = 0b1111 "Always off";
+ };
+ constants blmode "LED blink mode" {
+ ms200 = 0 "200ms on, 200ms off";
+ ms83 = 1 "83ms on, 83 ms off";
+ };
+ register ledctl rw addr(base, 0x0e00) "LED control" {
+ led0_mode 4 type(ledmode) "LED0/LINK# mode";
+ _ 1 mbz;
+ global_blink_mode 1 type(blmode) "Global blink mode";
+ led0_ivrt 1 "LED0 invert";
+ led0_blink 1 "LED0 blink";
+
+ led1_mode 4 type(ledmode) "LED1/LINK# mode";
+ _ 1 mbz;
+ led1_blink_mode 1 type(blmode) "Global blink mode";
+ led1_ivrt 1 "LED1 invert";
+ led1_blink 1 "LED1 blink";
+
+ led2_mode 4 type(ledmode) "LED2/LINK# mode";
+ _ 1 mbz;
+ led2_blink_mode 1 type(blmode) "Global blink mode";
+ led2_ivrt 1 "LED2 invert";
+ led2_blink 1 "LED2 blink";
+
+ led3_mode 4 type(ledmode) "LED3/LINK# mode";
+ _ 1 mbz;
+ led3_blink_mode 1 type(blmode) "Global blink mode";
+ led3_ivrt 1 "LED3 invert";
+ led3_blink 1 "LED3 blink";
+ };
+
+ // 13.3.22
+ register extcnf_ctrl rw addr(base, 0x0f00) "Extended config control" {
+ _ 1 mbz;
+ phy_we 1 "PHY write enable";
+ dud_en 1 "Extended dock/undock configuration enable";
+ _ 1;
+ dock_own 1 "Dock config owner";
+ mdio_swown 1 "MDIO software ownership";
+ mdio_hwown 1 "MDIO hoftware ownership";
+ _ 9;
+ ecp 12 "Extended configuration pointer";
+ _ 4;
+ };
+
+ // 13.3.23
+ register extcnf_size rw addr(base, 0x0f08) "Extended config size" {
+ phy_len 8 "Extended PHY configuration area length";
+ dock_len 8 "Extended dock configuration area length";
+ _ 8 mbz;
+ _ 8;
+ };
+
+ // 13.3.24
+ register pba rw addr(base, 0x1000) "Packet buffer allocation" {
+ rxa 16 "Rx packet buffer allocation in KB";
+ txa 16 "Tx packet buffer allocation in KB";
+ };
+
+ // 13.3.25
+ register eemngctl rw addr(base, 0x1010) "MNG EEPROM control" {
+ _ 18;
+ crg_done 1 "MNG configuration cycle done";
+ _ 13;
+ };
+
+ // 13.3.26
+ register sw_fw_sync rw addr(base, 0x5b5c) "Software/firmware sync" {
+ sw_eep_sm 1 "EEPROM access owned by software";
+ sw_phy_sm0 1 "PHY 0 access owned by software";
+ sw_phy_sm1 1 "PHY 1 access owned by software";
+ sw_mac_csr_sm 1 "Shared CSR access owned by software";
+ _ 12;
+ fw_eep_sm 1 "EEPROM access owned by firmware";
+ fw_phy_sm0 1 "PHY 0 access owned by firmware";
+ fw_phy_sm1 1 "PHY 1 access owned by firmware";
+ fw_mac_csr_sm 1 "Shared CSR access owned by firmware";
+ _ 12;
+ };
+
+ /************************************
+ * Interrupt registers
+ ***********************************/
+
+ // 13.3.27
+ regtype intreg "Interrupt register format" {
+ txdw 1 "Transmit descriptor written back";
+ txqe 1 "Transmit queue empty";
+ lsc 1 "Link status change";
+ rxseq 1 "Receive sequence error";
+ rxdmt0 1 "Receive descriptor minimum threshold reached";
+ _ 1;
+ rxo 1 "Receiver overrun";
+ rxt0 1 "Receiver timer interrupt";
+ _ 1;
+ mdac 1 "MDI/O access complete";
+ rxcfg 1 "Received configuration symbols";
+ _ 2;
+ gpi_sdp2 1 "General-purpose interrupt on SPD2";
+ gpi_sdp3 1 "General-purpose interrupt on SPD3";
+ txd_low 1 "Transmit descriptor low threshold";
+ srpd 1 "Small receive packet detected";
+ ack 1 "Receive ack frame detected";
+ _ 2;
+ rx_desc_fifo_par0 1 "Rx descriptor FIFO parity error 0";
+ tx_desc_fifo_par0 1 "Tx descriptor FIFO parity error 0";
+ pcie_master_par 1 "PCIe master data FIFO parity error";
+ pbpar 1 "Packet buffer parity error";
+ rx_desc_fifo_par1 1 "Rx descriptor FIFO parity error 1";
+ tx_desc_fifo_par1 1 "Tx descriptor FIFO parity error 1";
+ _ 5;
+ int_asserted 1 "Interrupt asserted";
+ };
+
+ // 13.3.27
+ register icr ro addr(base, 0x00c0) "Interrupt cause read" type(intreg);
+
+ // 13.3.28
+ register itr rw addr(base, 0x00c4) "Interrupt throttling rate" {
+ interval 16 "Minimum inter-interrupt interval (x256ns)";
+ _ 16 mbz;
+ };
+
+ // 13.3.29
+ register ics wo addr(base, 0x00c8) "Interrupt cause write" type(intreg);
+
+ // 13.3.30
+ register ims rw addr(base, 0x00d0) "Interrupt mask set/read" type(intreg);
+
+ // 13.3.31
+ register imc wo addr(base, 0x00d8) "Interrupt mask clear" type(intreg);
+
+ // 13.3.32
+ register iam rw addr(base, 0x00e0) "Interrupt ack auto mask" type(intreg);
+
+ regarray eitr addr(base, 0x1680)[9;0x4] "Extended Interrupt Throttle" {
+ _ 2 mbz;
+ interval 13 "Interval";
+ _ 1 mbz;
+ counter 16 "Down counter";
+ };
+
+ /************************************
+ * Receive registers
+ ***********************************/
+
+ // 13.3.33
+ constants lbmode "Loopback mode" {
+ lb_normal = 0b00 "Normal operation";
+ lb_mac = 0b01 "MAC loopback";
+ };
+ constants rxthresh "Received desc. threshold size" {
+ rdlen_2 = 0b00 "1/2 RDLEN";
+ rdlen_4 = 0b01 "1/4 RDLEN";
+ rdlen_8 = 0b10 "1/8 RDLEN";
+ };
+ constants dtype "Descriptor type" {
+ dt_legacy = 0b00 "Legacy descriptor type";
+ dt_split = 0b01 "Packet split descriptor type";
+ };
+ constants rxbsize "Receive buffer size" {
+ rxb2048 = 0b00 "2048 bytes";
+ rxb1024 = 0b01 "1024 or 16384 bytes";
+ rxb512 = 0b10 "512 or 8192 bytes";
+ rxb256 = 0b11 "256 or 4096 bytes";
+ };
+ register rctl rw addr(base, 0x0100) "Receive control" {
+ _ 1 mbz;
+ en 1 "Receiver enable";
+ sbp 1 "Store bad packets";
+ upe 1 "Unicast promiscuous enabled";
+ mpe 1 "Multicast promiscuous enabled";
+ lpe 1 "Long packet reception enable";
+ lbm 2 type(lbmode) "Loopback mode";
+ rdmts 2 type(rxthresh) "Receive descriptor minimum threshold size";
+ dtyp 2 type(dtype) "Descriptor type";
+ mo 2 "Multicast offset (12 bits starting at 36-val)";
+ _ 1 mbz;
+ bam 1 "Broadcast accept mode";
+ bsize 2 type(rxbsize) "Receive buffer size (see BSEX)";
+ vfe 1 "VLAN filter enable";
+ cfien 1 "Canonical form indicator enable";
+ cfi 1 "Canonical form indicator value";
+ _ 1 mbz;
+ dpf 1 "Discard pause frames";
+ pmcf 1 "Pass MAC control frames";
+ _ 1 mbz;
+ bsex 1 "Buffer size extension";
+ secrc 1 "Strip Ethernet CRC from packet";
+ flxbuf 4 "Flexible buffer size (in KB)";
+ _ 1 mbz;
+ };
+
+ // 13.3.34
+ register ert rw addr(base, 0x2008) "Early receive threshold" {
+ rxthresh 13 "Receive threshold value (x 8 bytes)";
+ _ 1;
+ _ 18 mbz;
+ };
+
+ // 13.3.35
+ register fcrtl rw addr(base, 0x2160) "Flow control rx threshold low" {
+ _ 3 mbz;
+ rtl 13 "Recieve threshold low";
+ _ 15 mbz;
+ xone 1 "XON enable";
+ };
+
+ // 13.3.36
+ register fcrth rw addr(base, 0x2168) "Flow control rx threshold high" {
+ _ 3 mbz;
+ rth 13 "Recieve threshold high";
+ _ 15 mbz;
+ flowcntdis 1 "Flow control disable";
+ };
+
+ // 13.3.37
+ register psrctl rw addr(base, 0x2170) "Packet split rx control" {
+ bsize0 7 "Receive buffer 0 size (x 128 bytes)";
+ _ 1 mbz;
+ bsize1 7 "Receive buffer 1 size (x 1 kbytes)";
+ _ 1 mbz;
+ bsize2 7 "Receive buffer 2 size (x 1 kbytes)";
+ _ 1 mbz;
+ bsize3 7 "Receive buffer 3 size (x 1 kbytes)";
+ _ 1 mbz;
+ };
+
+ // 13.3.38/46/39/47
+ regarray rdbal rw addr(base, 0x2800)[2;0x100]
+ "Rx descr. base addr low" type(uint32);
+ regarray rdbah rw addr(base, 0x2804)[2;0x100]
+ "Rx descr. base addr high" type(uint32);
+
+ // 13.3.40/48 and 13.3.62/71
+ // Note that the description of the transmit length (13.3.62/71) refers to
+ // the size of the descriptor buffer in bytes. This is misleading; the whole
+ // register (raw value) refers to that, but the bottom 7 bits must be zero.
+ regtype dqlen "Descriptor length value" {
+ _ 7 mbz;
+ len 13 "Num. descriptors (x8)";
+ _ 12 mbz;
+ };
+ regarray rdlen rw addr(base, 0x2808)[2;0x100]
+ "Rx descriptor length" type(dqlen);
+
+ // 13.3.41/49/42/50
+ regtype dqval "Descriptor head/tail value" {
+ val 16 "value";
+ _ 16 mbz;
+ };
+ regarray rdh rw addr(base, 0x2810)[2;0x100] "Rx descr. head" type(dqval);
+ regarray rdt rw addr(base, 0x2818)[2;0x100] "Rx descr. tail" type(dqval);
+
+ // 13.3.43
+ register rdtr rw addr(base, 0x2820) "Rx. interrupt delay timer" {
+ delay 16 "delay timer (x 1.024us)";
+ _ 15 mbz;
+ fpd 1 "Flush partial descriptor block";
+ };
+
+ // 13.3.44/51
+ constants threshgran "Threshold granularity" {
+ gran_cache = 0 "Cache line granularity";
+ gran_desc = 1 "Descriptor granularity";
+ };
+
+ regarray rxdctl rw addr(base, 0x2828)[2;0x100] "Rx descriptor control" {
+ pthresh 6 "Prefetch threshold";
+ _ 2 mbz;
+ hthresh 6 "Host threshold";
+ _ 2 mbz;
+ wthresh 6 "Write back threshold";
+ _ 2 mbz;
+ gran 1 type(threshgran) "Granularity";
+ _ 7 mbz;
+ };
+
+ regarray rxdctl_82575 rw also addr(base, 0x2828)[2;0x100] "Rx descriptor control" {
+ pthresh 6 "Prefetch threshold";
+ _ 2 mbz;
+ hthresh 6 "Host threshold";
+ _ 2 mbz;
+ wthresh 6 "Write back threshold";
+ _ 3 mbz;
+ enable 1 "Granularity";
+ swflush 1 "Receive Software Flush";
+ _ 5 mbz;
+ };
+
+ // 13.3.45
+ register radv rw addr(base, 0x282c) "Rx absolute intr. delay" {
+ idv 16 "Interrupt delay value";
+ _ 16 mbz;
+ };
+
+ // 13.3.52
+ register rsrpd rw addr(base, 0x2c00) "Rx small packet detect interrupt" {
+ size 12 "Max size of small packet";
+ _ 20 mbz;
+ };
+
+ // 13.3.53
+ register raid rw addr(base, 0x2c08) "Rx ACK interrupt delay" {
+ idv 16 "Interrupt delay value (x 1.024us)";
+ _ 16 mbz;
+ };
+
+ // 13.3.54
+ register cpuvec rw addr(base, 0x2c10) "CPU vector" type(uint32);
+
+ // 13.3.55
+ register rxcsum rw addr(base, 0x5000) "Receive checksum control" {
+ pcss 8 "Packet checksum start";
+ ipofld 1 "IP checksum offload enable";
+ tuofld 1 "TCP/UDP checksum offload enable";
+ _ 22 mbz;
+ };
+
+ // 13.3.56
+ register rfctl rw addr(base, 0x5008) "Receive filter control" {
+ iscsi_dis 1 "iSCSI filtering disable";
+ iscsi_dwc 5 "iSCSI dword count";
+ nfsw_dis 1 "NFS write filtering disable";
+ nfsr_dis 1 "NFS read filtering disable";
+ nfs_ver 2 "NFS version (+2)";
+ ipv6_dis 1 "IPv6 filtering disable";
+ ipv6xsum_dis 1 "IPv6 xsum disable";
+ ackdis 1 "ACK accelerator disable";
+ ackd_dis 1 "ACK data disable";
+ ipfrsp_dis 1 "IP fragment split disable";
+ exsten 1 "Extended status enable";
+ _ 16 mbz;
+ };
+
+ /************************************
+ * Transmit registers
+ ***********************************/
+
+ // 13.3.57
+ constants coldist "Recommended collision distances" {
+ cd_half = 0x200 "512 byte-times";
+ cd_full = 0x3f "64 byte-times";
+ cd_esb = 0x40 "64 byte-times (for 631xESB/632xESB)";
+ };
+ register tctl rw addr(base, 0x400) "Transmit control" {
+ _ 1 mbz;
+ en 1 "Transmit enable";
+ _ 1 mbz;
+ psp 1 "Pad short packets";
+ ct 8 "Collision threshold";
+ bst 10 "Back-Off Slot time";
+ swxoff 1 "Software XOFF transmission";
+ _ 1 mbz;
+ rtlc 1 "Retransmit on late collision";
+ unortx 1 "Underrun no re-transmit";
+ txcscmt 2 "Tx descriptor minimum threshold";
+ mulr 1 "Multiple request support";
+ _ 3;
+ };
+
+ // 13.3.58
+ register tctl_ext rw addr(base, 0x0404) "Transmit control extended" {
+ _ 10 mbz;
+ cold 10 type(coldist) "Collision distance";
+ _ 12;
+ };
+
+ // 13.3.59
+ register tipg rw addr(base, 0x0410) "Transmit IPQ" {
+ ipgt 10 "IPG back to back (x MAC clock, +4)";
+ ipgr1 10 "IPG Part 1";
+ ipgr2 10 "IPG after deferral";
+ _ 2 mbz;
+ };
+
+ //
+ // The e1000 has two transmit queues, hence two sets of the
+ // remaining registers
+ //
+
+ // 13.3.60/61/69/70
+ regarray tdbal rw addr(base, 0x3800)[2;0x100] "Tx descr. base addr. low"
+ type(uint32);
+ regarray tdbah rw addr(base, 0x3804)[2;0x100] "Tx descr. base addr. hi"
+ type(uint32);
+
+ // 13.3.62/71
+ regarray tdlen rw addr(base, 0x3808)[2;0x100] "Tx descr. length" type(dqlen);
+
+ // 13.3.63/64/73
+ regarray tdh rw addr(base, 0x3810)[2;0x100] "Tx descr. head" type(dqval);
+ regarray tdt rw addr(base, 0x3818)[2;0x100] "Tx descr. tail" type(dqval);
+
+ // 13.3.65
+ register tidv rw addr(base, 0x3820) "Transmit interrupt delay value" {
+ idv 16 "Interupt delay value";
+ _ 15 mbz;
+ fdp 1 wo "Flush partial description block";
+ };
+
+ // 13.3.66/74
+ regarray txdctl rw addr(base, 0x3828)[2;0x100] "Transmit descr. control queue" {
+ pthresh 6 "Prefetch threshold";
+ _ 2 mbz;
+ hthresh 8 "Host threshold";
+ wthresh 6 "Write back threshold";
+ _ 1 mb1;
+ _ 1;
+ gran 1 type(threshgran) "Granularity";
+ lwthresh 7 "Transmit descriptor low threshold";
+ };
+
+ regarray txdctl_82575 rw also addr(base, 0x3828)[4;0x100] "Transmit descr. control queue for 82575 cards" {
+ pthresh 6 "Prefetch threshold";
+ _ 2 mbz;
+ hthresh 6 "Host threshold";
+ _ 2;
+ wthresh 6 "Write back threshold";
+ _ 3 mb1;
+ enable 1 "Enable the queue";
+ swflsh 1 "Transmit Software Flush";
+ priority 1 "Priority";
+ _ 4;
+ };
+
+ // 13.3.67
+ register tadv rw addr(base, 0x382c) "Tx absolute intr. delay" {
+ idv 16 "Interrupt delay value";
+ _ 16 mbz;
+ };
+
+ // 13.3.68/75
+ regarray tarc rw addr(base, 0x3840)[2;0x100] "Tx arbitration counter" {
+ count 7 "Transmit arbitration count";
+ _ 1;
+ ratio 2 "Compensation ratio (1 / 2^val)";
+ enable 1 mb1;
+ _ 10 mbz;
+ _ 1 mb1;
+ _ 1 mbz;
+ _ 4 mb1;
+ _ 5 mbz;
+ };
+
+ /************************************
+ * Filter registers
+ ***********************************/
+
+ // 13.4.1
+ regarray mta rw addr(base, 0x5200)[128] "Multicast table array" type(uint32);
+
+ // 13.4.2
+ regarray ral rw addr(base, 0x5400)[16;8] "Receive address low" type(uint32);
+
+ // 13.4.3
+ constants addrsel "Address select" {
+ as_dest = 0b00 "Destination";
+ as_src = 0b01 "Source";
+ };
+ regarray rah rw addr(base, 0x5404)[16;8] "Receive address high" {
+ rah 16 "Receive address high";
+ asel 2 type(addrsel) "Address select";
+ _ 13 mbz;
+ av 1 "Address valid";
+ };
+
+ // 13.4.4
+ regarray vfta rw addr(base, 0x5600)[128]
+ "VLAN filter table array" type(uint32);
+
+ // 13.4.5
+ constants mrqen "Multiple rx queue enable" {
+ mrq_dis = 0b00 "Multiple queues disabled";
+ mrq_rss = 0b01 "Multiple queues enabled by MSFT RSS";
+ };
+ register mrq rw addr(base, 0x5818) "Multiple queues receive command" {
+ mrqe 2 type(mrqen) "Multiple rx queues enable";
+ rssie 1 "RSS interrupt enable";
+ _ 13 mbz;
+ tcp4 1 "Enable TCP IPv4 hash";
+ ipv4 1 "Enable IPv4 hash";
+ tcp6ex 1 "Enable TCP IPv6 Ex hash";
+ ipv6ex 1 "Enable IPv6 Ex hash";
+ ipv6 1 "Enable IPv6 hash";
+ _ 11;
+ };
+
+ // 13.4.6
+ register rssim rw addr(base, 0x5864) "RSS interrupt mask" type(uint32);
+
+ // 13.4.7
+ register rssir rw addr(base, 0x5868) "RSS interrupt request" type(uint32);
+
+ // 13.4.8
+ regarray reta rw addr(base, 0x5c00)[128] "Redirection table" type(uint8);
+
+ // 13.4.9
+ regarray rssrk rw addr(base, 0x5c80)[40] "RSS Random key" type(uint8);
+
+ /************************************
+ * Wakeup registers
+ ***********************************/
+
+ // 13.5.1
+ register wuc rw addr(base, 0x5800) "Wakeup control" {
+ apme 1 "Advanced power mgmt enable";
+ pme_en 1 "PME enable";
+ pme_stat 1 "PME status";
+ apmpme 1 "Assert PME on APM wakeup";
+ _ 28;
+ };
+
+ // 13.5.2
+ regtype wakeup "Wakeup register" {
+ lnkc 1 "Link status change";
+ mag 1 "Magic packet";
+ ex 1 "Directed exact";
+ mc 1 "Directed multicast";
+ bc 1 "Broadcast";
+ arp 1 "ARP request packet";
+ ipv4 1 "Directed IPv4";
+ ipv6 1 "Directed IPv6";
+ _ 7 mbz;
+ notco 1 "Ignore TCO/management packets";
+ flx0 1 "Flexible filter 0 enable";
+ flx1 1 "Flexible filter 1 enable";
+ flx2 1 "Flexible filter 2 enable";
+ flx3 1 "Flexible filter 3 enable";
+ _ 12 mbz;
+ };
+ register wufc rw addr(base, 0x5808) "Wakeup filter control" type(wakeup);
+
+ // 13.5.3
+ register wus ro addr(base, 0x5810) "Wakeup status" type(wakeup);
+
+ // 13.5.4
+ register ipav rw addr(base, 0x5838) "IP address valid" {
+ v40 1 "IPv4 address 0 valid";
+ v41 1 "IPv4 address 1 valid";
+ v42 1 "IPv4 address 2 valid";
+ v43 1 "IPv4 address 3 valid";
+ _ 12 mbz;
+ v60 1 "IPv6 address 0 valid";
+ _ 15 mbz;
+ };
+
+ // 13.5.5
+ regarray ip4at rw addr(base, 0x5840)[4;8]
+ "IPv4 address table" type(uint32);
+
+ // 13.5.6
+ regarray ip6at rw addr(base, 0x5880)[4] "IPv6 address table" type(uint32);
+
+ // 13.5.7
+ register wupl rw addr(base, 0x5900) "Wakeup packet length" {
+ len 12 "Length";
+ _ 20 mbz;
+ };
+
+ // 13.5.8
+ regarray wupm rw addr(base, 0x5a00)[32] "Wakeup packet memory" type(uint32);
+
+ // 13.5.9
+ regarray fflt rw addr(base, 0x5f00)[4;8] "Flexible filter length table" {
+ len 11 "Length";
+ _ 21 mbz;
+ };
+ regarray ffltco rw addr(base, 0x5f20)[2;8] "Flexible filter length table" {
+ tcolen 11 "Length";
+ _ 21 mbz;
+ };
+
+ // 13.5.10
+ regarray ffmt rw addr(base, 0x9000)[128;8] "Flexible filter mask table" {
+ mask 4 "mask";
+ _ 28 mbz;
+ };
+
+ // 13.5.11
+ regarray ffvt rw addr(base, 0x9800)[128;8] "Flexible filter value table" {
+ val0 8 "Value 0";
+ val1 8 "Value 1";
+ val2 8 "Value 2";
+ val3 8 "Value 3";
+ };
+
+ /************************************
+ * Management control registers
+ ***********************************/
+
+ // 13.6.1
+ register manc rw addr(base, 0x5820) "Management control" {
+ _ 3 mbz;
+ en_flexport0 1 "Enable flex UDP/TCP port 0 filtering";
+ en_flexport1 1 "Enable flex UDP/TCP port 1 filtering";
+ en_flexport2 1 "Enable flex UDP/TCP port 2 filtering";
+ flex_tco1_filter 1 "Enable TCO filter 1";
+ flex_tco0_filter 1 "Enable TCO filter 0";
+ rmcp_en 1 "Enable RMCP 0x026f filtering";
+ o298_en 1 "Enable RMCP 0x0298 filtering";
+ _ 3 mbz;
+ arp_req_en 1 "Enable ARP request filtering";
+ neighbor_en 1 "Enable neighbor discovery filtering";
+ arp_res_en 1 "Enable ARP response filtering";
+ tco_reset 1 "TCO reset occurred";
+ rcv_tco_en 1 "Receive TCO packets enable";
+ blk_phyrst_on_ide 1 "Block PHY reset and power on state changes";
+ rcv_all 1 "Receive all enable";
+ en_mac16_filter 1 "Enable MAC address 16 filtering";
+ en_mng2host 1 "Enable firmware packets to host memory";
+ en_ip_addrfilter 1 "Enable IP address filtering";
+ en_xsum_filter 1 "Enable Xsum filtering to firmware";
+ br_en 1 "Enable broadcast filtering";
+ _ 7 mbz;
+ };
+
+ /************************************
+ * PCIe registers
+ ***********************************/
+
+ // NOTE: Intel in their infinite wisdom have chosen to list these
+ // registers MSBfirst in the documentation, as opposed to all the
+ // others which are LSBfirst...
+
+ // 13.7.1
+ register gcr rw addr(base, 0x5b00) "PCIe control" {
+ rxd_nosnoop 1 "Receive data write";
+ rxdscw_nosnoop 1 "Receive descriptor write";
+ rxdscr_nosnoop 1 "Receive descriptor read";
+ txd_nosnoop 1 "Transmit data write";
+ txdscw_nosnoop 1 "Transmit descriptor write";
+ txdscr_nosnoop 1 "Transmit descriptor read";
+ elec_idle_in0 1 ro "SerDes0 internal electrical idle indicator";
+ elec_idle_in1 1 ro "SerDes1 internal electrical idle indicator";
+ self_test_enable 1 "Perform self test";
+ _ 12 mbz;
+ logheader 1 "Log header into PCI config space";
+ _ 1 mbz;
+ l1el_msb 1 ro "L1 Entry latency msb";
+ l0s_el 1 "L0s entry latency";
+ l1el_lsb 2 ro "L1 Entry latency lsbs";
+ l1_aw_l0s 1 "L1 act without L0s_rx correlation";
+ gio_dis_rderr 1 "Disable running disparity err";
+ gio_good_10s 1 "Force good PCIe l0s training";
+ self_test_result 1 "Result of self test";
+ dis_tmout 1 "Disable PCIe timeout mechanism";
+ };
+
+ // 13.7.2
+ register gscl1 rw addr(base, 0x5b10) "PCIe statistics control 1" {
+ count_en0 1 "Enable PCIe stats counter 0";
+ count_en1 1 "Enable PCIe stats counter 1";
+ count_en2 1 "Enable PCIe stats counter 2";
+ count_en3 1 "Enable PCIe stats counter 3";
+ _ 23;
+ count_test 1 "Test bit";
+ en_64bit 1 "Enable two 64-bit counters instead of 4 32-bit";
+ count_reset 1 "Reset indication of PCIe stats";
+ count_stop 1 "Stop indication";
+ count_start 1 "Start indication";
+ };
+
+ // 13.7.3
+ register gscl2 rw addr(base, 0x5b14) "PCIe statistics control 2" {
+ event0 8 "Event number that counter 0 counts";
+ event1 8 "Event number that counter 1 counts";
+ event2 8 "Event number that counter 2 counts";
+ event3 8 "Event number that counter 3 counts";
+ };
+
+ // 13.7.4
+ register gscl3 rw addr(base, 0x5b18) "PCIe statistics control 3" {
+ fc_th0 12 "Threshold of flow control credits 0";
+ _ 4;
+ fc_th1 12 "Threshold of flow control credits 1";
+ _ 4;
+ };
+
+ // 13.7.5
+ register gscl4 rw addr(base, 0x5b1c) "PCIe statistics control 4" {
+ coml_th 10 "Completions latency threshold";
+ rb_th 6 "Retry buffer threshold";
+ _ 16;
+ };
+
+ // 13.7.6-9
+ regarray gscn rw addr(base, 0x5b20)[4] "PCIe counter" type(uint32);
+
+ // 13.7.10
+ constants fps "Function power state" {
+ fps_dr = 0b00 "DR";
+ fps_d0u = 0b01 "D0u";
+ fps_d0a = 0b10 "Doa";
+ fps_d3 = 0b11 "D3";
+ };
+ register factps ro addr(base, 0x5b30) "Fn. active & power state to MNG" {
+ f0ps 2 type(fps) "Power state of fn. 0";
+ lan0v 1 "LAN 0 valid enable";
+ f0aux 1 "Fn. 0 aux power enable shadow";
+ lan0en 1 "LAN 0 enabled";
+ _ 1;
+ f1ps 2 type(fps) "Power state of fn. 1";
+ lan1v 1 "LAN 1 valid enable";
+ f1aux 1 "Fn. 1 aux power enable shadow";
+ lan1en 1 "LAN 1 enabled";
+ _ 1;
+ f2ps 2 type(fps) "Power state of fn. 2";
+ ide_en 1 "IDE (function 2) enable";
+ f2aux 1 "Fn. 2 aux power enable shadow";
+ _ 2;
+ f3ps 2 type(fps) "Power state of fn. 3";
+ sp_en 1 "SP (function 3) enable";
+ f3aux 1 "Fn. 3 aux power enable shadow";
+ _ 2;
+ f4ps 2 type(fps) "Power state of fn. 4";
+ ipmi_en 1 "IPMI (function 4) enable";
+ f4aux 1 "Fn. 4 aux power enable shadow";
+ _ 1;
+ mngcg 1 "MNG clock gated";
+ lanfs 1 "LAN function select";
+ pmchg 1 "PM state changed";
+ };
+
+ // 13.7.11-12
+ regtype anal_ctl "Analog circuit configuration" {
+ data 8 "Data to SerDes";
+ address 8 "Address to SerDes";
+ _ 15;
+ done 1 "Done indicator";
+ };
+ regarray gioanactl rw addr(base,0x5b34)[4] "Analog control" type(anal_ctl);
+
+ // 13.7.13
+ register gioanactlall rw addr(base,0x5b44) "Analog control" type(anal_ctl);
+
+ // 13.7.14
+ register ccmctl rw addr(base,0x5b48) "CCM analog control" type(anal_ctl);
+
+ // 13.7.15
+ register anactl rw also addr(base,0x5b48) "Analog control" {
+ data 8 "Data to/from analog register";
+ address 8 "Address of analog register";
+ _ 14;
+ write 1 "Read/write command";
+ done 1 "Done indication";
+ };
+
+ // 13.7.16
+ register scctl rw addr(base, 0x5b4c) "SCC analog control" type(anal_ctl);
+
+ // 13.7.17
+ register swsm rw addr(base, 0x5b50) "Software semaphore" {
+ smbi 1 "Semaphore bit";
+ swesmbi 1 "Software EEPROM semaphore bit";
+ wmng 1 "Wake MNG clock";
+ _ 29;
+ };
+
+ // 13.7.18
+ constants fwmode "Firmware mode" {
+ nomng = 0b000 "No MNG";
+ ptmode = 0b010 "PT mode";
+ hieo = 0b100 "Host interface firmware";
+ };
+ constants pcierr "PCIe external error indication" {
+ pe_none = 0x00 "No error";
+ pe_mschk = 0x01 "Bad checksum in manageability sections";
+ pe_prot = 0x02 "EEPROM protection disabled";
+ pe_clkoff = 0x03 "Clock off command executed";
+ pe_flchk = 0x04 "Bad checksum in flash header";
+ pe_pschk = 0x05 "Bad checksum in patch section";
+ pe_lschk = 0x06 "Bad checksum in loader section";
+ pe_dschk = 0x07 "Bad checksum in diagnostic section";
+ pe_inval = 0x08 "Invalid firmware mode";
+ pe_tlbe = 0x09 "TLB table exceeded";
+ pe_eerd = 0x0a "EEPROM read failed";
+ pe_hwver = 0x0b "Bad hardware version in patch load";
+ pe_sfrd = 0x0c "SFlash read failed";
+ pe_unspec = 0x0d "Unspecified error";
+ pe_auth = 0x0e "Flash authentication failed";
+ pe_pfrd = 0x0f "PFlash read failed";
+ pe_ifep = 0x10 "Invalid Flash entry point";
+ };
+ register fwsm rw addr(base, 0x5b54) "Firmware semaphore" {
+ eep_fw 1 "EEPROM firmware semaphore";
+ fw_mode 3 type(fwmode) "Firmware mode";
+ ide_on 1 "IDE redirection on";
+ sol_on 1 "SOL on";
+ eep_rl 1 "EEPROM reloaded indication";
+ _ 8;
+ fwval 1 "Firmware valid bit";
+ rstcnt 3 "Reset counter";
+ error 6 type(pcierr) "External error indication";
+ _ 7;
+ };
+
+ /************************************
+ * Statistics registers
+ ***********************************/
+
+ // 13.8 ff
+ register crcerrs rc addr(base, 0x4000)
+ "CRC error count" type(uint32);
+ register algnerrc rc addr(base, 0x4004)
+ "Alignment error count" type(uint32);
+ register symerrs rc addr(base, 0x4008)
+ "Symbol error count" type(uint32);
+ register rxerrc rc addr(base, 0x400c)
+ "Receive error count" type(uint32);
+ register mpc rc addr(base, 0x4010)
+ "Missed packets count" type(uint32);
+ register scc rc addr(base, 0x4014)
+ "Single collision count" type(uint32);
+ register ecol rc addr(base, 0x4018)
+ "Excessive collisions count" type(uint32);
+ register mcc rc addr(base, 0x401c)
+ "Multiple collision count" type(uint32);
+ register latecol rc addr(base, 0x4020)
+ "Late collisions count" type(uint32);
+ register colc rc addr(base, 0x4028)
+ "Collision count" type(uint32);
+ register dc rc addr(base, 0x4030)
+ "Defer count" type(uint32);
+ register tncrs rc addr(base, 0x4034)
+ "Transmit with no CRS" type(uint32);
+ register sec rc addr(base, 0x4038)
+ "Sequence error count" type(uint32);
+ register cexterr rc addr(base, 0x403c)
+ "Carrier extension error count" type(uint32);
+ register rlec rc addr(base, 0x4040)
+ "Receive length error count" type(uint32);
+ register xonrxc rc addr(base, 0x4048)
+ "XON received count" type(uint32);
+ register xontxc rc addr(base, 0x404c)
+ "XON transmitted count" type(uint32);
+ register xoffrxc rc addr(base, 0x4050)
+ "XOFF received count" type(uint32);
+ register xofftxc rc addr(base, 0x4054)
+ "XOFF transmitted count" type(uint32);
+ register fcurc rc addr(base, 0x4058)
+ "FC received unsupported count" type(uint32);
+ register prc64 rc addr(base, 0x405c)
+ "Packets received (64 bytes) count" type(uint32);
+ register prc127 rc addr(base, 0x4060)
+ "Packets received (65-127 bytes) count" type(uint32);
+ register prc255 rc addr(base, 0x4064)
+ "Packets received (128-255 bytes) count" type(uint32);
+ register prc511 rc addr(base, 0x4068)
+ "Packets received (256-511 bytes) count" type(uint32);
+ register prc1023 rc addr(base, 0x406c)
+ "Packets received (512-1023 bytes) count" type(uint32);
+ register prc1522 rc addr(base, 0x4070)
+ "Packets received (1024-max bytes) count" type(uint32);
+ register gprc rc addr(base, 0x4074)
+ "Good packets received count" type(uint32);
+ register bprc rc addr(base, 0x4078)
+ "Broadcast packets received count" type(uint32);
+ register mcprc rc addr(base, 0x407c)
+ "Multicast packets received count" type(uint32);
+ register gptc rc addr(base, 0x4080)
+ "Good packets transmitted count" type(uint32);
+ register gorcl rc addr(base, 0x4088)
+ "Good octets received count low" type(uint32);
+ register gorch rc addr(base, 0x408c)
+ "Good octets received count high" type(uint32);
+ register gotcl rc addr(base, 0x4090)
+ "Good octets transmitted count low" type(uint32);
+ register gotch rc addr(base, 0x4094)
+ "Good octets transmitted count high" type(uint32);
+ register rnbc rc addr(base, 0x40a0)
+ "Receive no buffers count" type(uint32);
+ register ruc rc addr(base, 0x40a4)
+ "Receive undersize count" type(uint32);
+ register rfc rc addr(base, 0x40a8)
+ "Receive fragment count" type(uint32);
+ register roc rc addr(base, 0x40ac)
+ "Receive oversize count" type(uint32);
+ register rjc rc addr(base, 0x40b0)
+ "Receive jabber count" type(uint32);
+ register mprc rc addr(base, 0x40b4)
+ "Management packets receive count" type(uint32);
+ register mpdc rc addr(base, 0x40b8)
+ "Management packets dropped count" type(uint32);
+ register mptc rc addr(base, 0x40bc)
+ "Management packets transmitted count" type(uint32);
+ register torl rc addr(base, 0x40c0)
+ "Total octets received low" type(uint32);
+ register torh rc addr(base, 0x40c4)
+ "Total octets received high" type(uint32);
+ register totl rc addr(base, 0x40c8)
+ "Total octets transmitted low" type(uint32);
+ register toth rc addr(base, 0x40cc)
+ "Total octets transmitted high" type(uint32);
+ register tpr rc addr(base, 0x40d0)
+ "Total packets received" type(uint32);
+ register tpt rc addr(base, 0x40d4)
+ "Total packets transmitted" type(uint32);
+ register ptc64 rc addr(base, 0x40d8)
+ "Packets transmitted (64 bytes) count" type(uint32);
+ register ptc127 rc addr(base, 0x40dc)
+ "Packets transmitted (65-127 bytes) count" type(uint32);
+ register ptc255 rc addr(base, 0x40e0)
+ "Packets transmitted (128-255 bytes) count" type(uint32);
+ register ptc511 rc addr(base, 0x40e4)
+ "Packets transmitted (256-511 bytes) count" type(uint32);
+ register ptc1023 rc addr(base, 0x40e8)
+ "Packets transmitted (512-1023 bytes) count" type(uint32);
+ register ptc1522 rc addr(base, 0x40ec)
+ "Packets transmitted (1024-max bytes) count" type(uint32);
+ register mcptc rc addr(base, 0x40f0)
+ "Multicast packets transmitted count" type(uint32);
+ register bptc rc addr(base, 0x40f4)
+ "Broadcast packets transmitted count" type(uint32);
+ register tsctc rc addr(base, 0x40f8)
+ "TCP segmentation context transmitted count" type(uint32);
+ register tsctfc rc addr(base, 0x40fc)
+ "TCP segmentation context tx fail count" type(uint32);
+ register iac rc addr(base, 0x4100)
+ "Interrupt assertion count" type(uint32);
+ register icrxptc rc addr(base, 0x4104)
+ "Interrupt cause rx packet timer expire count" type(uint32);
+ register icrxatc rc addr(base, 0x4108)
+ "Interrupt cause rx absolute timer expire count" type(uint32);
+ register ictxptc rc addr(base, 0x410c)
+ "Interrupt cause tx packet timer expire count" type(uint32);
+ register ictxatc rc addr(base, 0x4110)
+ "Interrupt cause tx absolute timer expire count" type(uint32);
+ register ictxqec rc addr(base, 0x4118)
+ "Interrupt cause transmit queue empty count" type(uint32);
+ register ictxdltc rc addr(base, 0x411c)
+ "Interrupt cause transmit descriptor low threshold count" type(uint32);
+ register icrxdmtc rc addr(base, 0x4120)
+ "Interrupt cause receive descriptor minimum threshold count" type(uint32);
+ register icrxoc rc addr(base, 0x4124)
+ "Interrupt cause receive overrun count" type(uint32);
+
+ regarray statsregs rc also addr(base, 0x4000)[74]
+ "All stats registers" type(uint32);
+
+
+ /************************************
+ * Descriptors
+ ***********************************/
+
+ // 3.2.4
+ datatype legacy_rdesc lsbfirst(64) "Legacy rx descriptor" {
+ addr 64 "Buffer address";
+ length 16 "Packet length";
+ checksum 16 "Packet checksum";
+ // Status
+ dd 1 "Descriptor done";
+ eop 1 "End of packet";
+ ixsm 1 "Ignore checksum indication";
+ vp 1 "Packet is 802.1q (matched VET)";
+ udpcs 1 "UDP checksum calculated on packet";
+ tcpcs 1 "TCP checksum calculated on packet";
+ ipcs 1 "IPv4 checksum calculated on packet";
+ pif 1 "Passed in-exact filter";
+ // Errors
+ ce 1 "CRC or alignment error";
+ se 1 "Symbol error";
+ seq 1 "Sequence error";
+ _ 2;
+ tcpe 1 "TCP/UDP checksum error";
+ ipe 1 "IPv4 checksum error";
+ rxe 1 "RX data error";
+ // VLAN tag field
+ vlan 12 "VLAN id";
+ cr 1 "Canonical form indicator";
+ pri 3 "802.1p priority";
+ };
+
+ // 3.2.5
+ datatype rdesc_read lsbfirst(64) "Extended rx descriptor (read format)" {
+ addr 64 "Buffer address";
+ dd 1 "Descriptor done";
+ _ 63;
+ };
+ datatype rdesc_write lsbfirst(64) "Extended rx descriptor (write format)" {
+ // MRQ
+ rss 4 type(rsstype) "RSS type";
+ _ 4;
+ queue 5 "Receive queue";
+ _ 19;
+ // IP id; note that the RSS hash can overlay the next two fields
+ ipid 16 "IP header identification field";
+ // Checksum
+ checksum 16 "Packet checksum";
+ // Extended status
+ dd 1 "Descriptor done";
+ eop 1 "End of packet";
+ ixsm 1 "Ignore checksum indication";
+ vp 1 "Packet is 802.1q (matched VET)";
+ udpcs 1 "UDP checksum calculated on packet";
+ tcpcs 1 "TCP checksum calculated on packet";
+ ipcs 1 "IPv4 checksum calculated on packet";
+ pif 1 "Passed in-exact filter";
+ _ 1;
+ ipidv 1 "IP identification valid";
+ udpv 1 "Valid UDP checksum";
+ _ 4;
+ ack 1 "ACK packet identification";
+ _ 4;
+ // Extended errors
+ _ 4;
+ ce 1 "CRC or alignment error";
+ se 1 "Symbol error";
+ seq 1 "Sequence error";
+ _ 2;
+ tcpe 1 "TCP/UDP checksum error";
+ ipe 1 "IPv4 checksum error";
+ rxe 1 "RX data error";
+ // Length
+ length 16 "Packet length";
+ // VLAN tag field
+ vlan 12 "VLAN id";
+ cr 1 "Canonical form indicator";
+ pri 3 "802.1p priority";
+ };
+
+ // 3.2.5.4
+ constants rsstype "RSS computation type" {
+ no_rss = 0x0 "No RS computation";
+ tcp_v4 = 0x1 "IPv4 with TCP hash";
+ ipv4 = 0x2 "IPv4 hash";
+ tcp_v6 = 0x3 "IPv6 with TCP hash";
+ ipv6 = 0x5 "IPv6 hash";
+ };
+
+
+};
--- /dev/null
+/*
+ * Copyright (c) 2014 ETH Zurich. All rights reserved.
+ *
+ * This file is distributed under the terms in the attached LICENSE file.
+ * If you do not find this file, copies can be found by writing to:
+ * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
+ */
+
+/*
+ * knc_sbox.dev
+ *
+ * description: intel e1000 family gigabit ethernet nics
+ */
+
+device knc_sbox lsbfirst ( addr base ) "intel xeon phi (knights corner) sbox" {
+
+register oc_i2c_icr rw addr(base, 0x1000) "foo" { };
+register thermal_status rw addr(base, 0x1018) "foo" { };
+register thermal_interrupt_enable rw addr(base, 0x101c) "foo" { };
+register status_fan1 rw addr(base, 0x1024) "foo" { };
+register status_fan2 rw addr(base, 0x1028) "foo" { };
+register speed_override_fan rw addr(base, 0x102c) "foo" { };
+register board_temp1 rw addr(base, 0x1030) "foo" { };
+register board_temp2 rw addr(base, 0x1034) "foo" { };
+register board_voltage_sense rw addr(base, 0x1038) "foo" { };
+register current_die_temp0 rw addr(base, 0x103c) "foo" { };
+register current_die_temp1 rw addr(base, 0x1040) "foo" { };
+register current_die_temp2 rw addr(base, 0x1044) "foo" { };
+register max_die_temp0 rw addr(base, 0x1048) "foo" { };
+register max_die_temp1 rw addr(base, 0x104c) "foo" { };
+register max_die_temp2 rw addr(base, 0x1050) "foo" { };
+register elapsed_time_low rw addr(base, 0x1074) "foo" { };
+register elapsed_time_high rw addr(base, 0x1078) "foo" { };
+register fail_safe_offset rw addr(base, 0x2004) "foo" { };
+register current_clk_ratio rw addr(base, 0x3004) "foo" { };
+register smpt00 rw addr(base, 0x3100) "foo" { };
+register smpt02 rw addr(base, 0x3108) "foo" { };
+register rgcr rw addr(base, 0x4010) "foo" { };
+register dstat rw addr(base, 0x4014) "foo" { };
+register pcie_pci_revision_id_and_c_0x8 rw addr(base, 0x5808) "foo" { };
+register pcie_bar_enable rw addr(base, 0x5cd4) "foo" { };
+register sicr0 rw addr(base, 0x9004) "foo" { };
+register sice0 rw addr(base, 0x900c) "foo" { };
+register sicc0 rw addr(base, 0x9010) "foo" { };
+register sicr1 rw addr(base, 0x901c) "foo" { };
+register sicc1 rw addr(base, 0x9028) "foo" { };
+register pmu_period_sel rw addr(base, 0x1070) "foo" { };
+register thermal_status_interrupt rw addr(base, 0x107c) "foo" { };
+register thermal_status_2 rw addr(base, 0x1080) "foo" { };
+register thermal_test_2 rw addr(base, 0x1084) "foo" { };
+register corefreq rw addr(base, 0x4100) "foo" { };
+register corevolt rw addr(base, 0x4104) "foo" { };
+register memoryfreq rw addr(base, 0x4108) "foo" { };
+register memvolt rw addr(base, 0x410c) "foo" { };
+register sdbic0 rw addr(base, 0xcc90) "foo" { };
+register sdbic1 rw addr(base, 0xcc94) "foo" { };
+register sdbic2 rw addr(base, 0xcc98) "foo" { };
+register sdbic3 rw addr(base, 0xcc9c) "foo" { };
+register mxar0 rw addr(base, 0x9040) "foo" { };
+register mxar0_k1om rw addr(base, 0x9044) "foo" { };
+register mxar1 rw addr(base, 0x9044) "foo" { };
+register mxar2 rw addr(base, 0x9048) "foo" { };
+register mxar3 rw addr(base, 0x904c) "foo" { };
+register mxar4 rw addr(base, 0x9050) "foo" { };
+register mxar5 rw addr(base, 0x9054) "foo" { };
+register mxar6 rw addr(base, 0x9058) "foo" { };
+register mxar7 rw addr(base, 0x905c) "foo" { };
+register mxar8 rw addr(base, 0x9060) "foo" { };
+register mxar9 rw addr(base, 0x9064) "foo" { };
+register mxar10 rw addr(base, 0x9068) "foo" { };
+register mxar11 rw addr(base, 0x906c) "foo" { };
+register mxar12 rw addr(base, 0x9070) "foo" { };
+register mxar13 rw addr(base, 0x9074) "foo" { };
+register mxar14 rw addr(base, 0x9078) "foo" { };
+register mxar15 rw addr(base, 0x907c) "foo" { };
+register msixpbacr rw addr(base, 0x9080) "foo" { };
+register msixpbacr_k1om rw addr(base, 0x9084) "foo" { };
+register dcar_0 rw addr(base, 0xa000) "foo" { };
+register dhpr_0 rw addr(base, 0xa004) "foo" { };
+register dtpr_0 rw addr(base, 0xa008) "foo" { };
+register daux_lo_0 rw addr(base, 0xa00c) "foo" { };
+register daux_hi_0 rw addr(base, 0xa010) "foo" { };
+register drar_lo_0 rw addr(base, 0xa014) "foo" { };
+register drar_hi_0 rw addr(base, 0xa018) "foo" { };
+register ditr_0 rw addr(base, 0xa01c) "foo" { };
+register dstat_0 rw addr(base, 0xa020) "foo" { };
+register dstatwb_lo_0 rw addr(base, 0xa024) "foo" { };
+register dstatwb_hi_0 rw addr(base, 0xa028) "foo" { };
+register dcherr_0 rw addr(base, 0xa02c) "foo" { };
+register dcherrmsk_0 rw addr(base, 0xa030) "foo" { };
+register dcar_1 rw addr(base, 0xa040) "foo" { };
+register dhpr_1 rw addr(base, 0xa044) "foo" { };
+register dtpr_1 rw addr(base, 0xa048) "foo" { };
+register daux_lo_1 rw addr(base, 0xa04c) "foo" { };
+register daux_hi_1 rw addr(base, 0xa050) "foo" { };
+register drar_lo_1 rw addr(base, 0xa054) "foo" { };
+register drar_hi_1 rw addr(base, 0xa058) "foo" { };
+register ditr_1 rw addr(base, 0xa05c) "foo" { };
+register dstat_1 rw addr(base, 0xa060) "foo" { };
+register dstatwb_lo_1 rw addr(base, 0xa064) "foo" { };
+register dstatwb_hi_1 rw addr(base, 0xa068) "foo" { };
+register dcherr_1 rw addr(base, 0xa06c) "foo" { };
+register dcherrmsk_1 rw addr(base, 0xa070) "foo" { };
+register dcar_2 rw addr(base, 0xa080) "foo" { };
+register dhpr_2 rw addr(base, 0xa084) "foo" { };
+register dtpr_2 rw addr(base, 0xa088) "foo" { };
+register daux_lo_2 rw addr(base, 0xa08c) "foo" { };
+register daux_hi_2 rw addr(base, 0xa090) "foo" { };
+register drar_lo_2 rw addr(base, 0xa094) "foo" { };
+register drar_hi_2 rw addr(base, 0xa098) "foo" { };
+register ditr_2 rw addr(base, 0xa09c) "foo" { };
+register dstat_2 rw addr(base, 0xa0a0) "foo" { };
+register dstatwb_lo_2 rw addr(base, 0xa0a4) "foo" { };
+register dstatwb_hi_2 rw addr(base, 0xa0a8) "foo" { };
+register dcherr_2 rw addr(base, 0xa0ac) "foo" { };
+register dcherrmsk_2 rw addr(base, 0xa0b0) "foo" { };
+register dcar_3 rw addr(base, 0xa0c0) "foo" { };
+register dhpr_3 rw addr(base, 0xa0c4) "foo" { };
+register dtpr_3 rw addr(base, 0xa0c8) "foo" { };
+register daux_lo_3 rw addr(base, 0xa0cc) "foo" { };
+register daux_hi_3 rw addr(base, 0xa0d0) "foo" { };
+register drar_lo_3 rw addr(base, 0xa0d4) "foo" { };
+register drar_hi_3 rw addr(base, 0xa0d8) "foo" { };
+register ditr_3 rw addr(base, 0xa0dc) "foo" { };
+register dstat_3 rw addr(base, 0xa0e0) "foo" { };
+register dstatwb_lo_3 rw addr(base, 0xa0e4) "foo" { };
+register dstatwb_hi_3 rw addr(base, 0xa0e8) "foo" { };
+register dcherr_3 rw addr(base, 0xa0ec) "foo" { };
+register dcherrmsk_3 rw addr(base, 0xa0f0) "foo" { };
+register dcar_4 rw addr(base, 0xa100) "foo" { };
+register dhpr_4 rw addr(base, 0xa104) "foo" { };
+register dtpr_4 rw addr(base, 0xa108) "foo" { };
+register daux_lo_4 rw addr(base, 0xa10c) "foo" { };
+register daux_hi_4 rw addr(base, 0xa110) "foo" { };
+register drar_lo_4 rw addr(base, 0xa114) "foo" { };
+register drar_hi_4 rw addr(base, 0xa118) "foo" { };
+register ditr_4 rw addr(base, 0xa11c) "foo" { };
+register dstat_4 rw addr(base, 0xa120) "foo" { };
+register dstatwb_lo_4 rw addr(base, 0xa124) "foo" { };
+register dstatwb_hi_4 rw addr(base, 0xa128) "foo" { };
+register dcherr_4 rw addr(base, 0xa12c) "foo" { };
+register dcherrmsk_4 rw addr(base, 0xa130) "foo" { };
+register dcar_5 rw addr(base, 0xa140) "foo" { };
+register dhpr_5 rw addr(base, 0xa144) "foo" { };
+register dtpr_5 rw addr(base, 0xa148) "foo" { };
+register daux_lo_5 rw addr(base, 0xa14c) "foo" { };
+register daux_hi_5 rw addr(base, 0xa150) "foo" { };
+register drar_lo_5 rw addr(base, 0xa154) "foo" { };
+register drar_hi_5 rw addr(base, 0xa158) "foo" { };
+register ditr_5 rw addr(base, 0xa15c) "foo" { };
+register dstat_5 rw addr(base, 0xa160) "foo" { };
+register dstatwb_lo_5 rw addr(base, 0xa164) "foo" { };
+register dstatwb_hi_5 rw addr(base, 0xa168) "foo" { };
+register dcherr_5 rw addr(base, 0xa16c) "foo" { };
+register dcherrmsk_5 rw addr(base, 0xa170) "foo" { };
+register dcar_6 rw addr(base, 0xa180) "foo" { };
+register dhpr_6 rw addr(base, 0xa184) "foo" { };
+register dtpr_6 rw addr(base, 0xa188) "foo" { };
+register daux_lo_6 rw addr(base, 0xa18c) "foo" { };
+register daux_hi_6 rw addr(base, 0xa190) "foo" { };
+register drar_lo_6 rw addr(base, 0xa194) "foo" { };
+register drar_hi_6 rw addr(base, 0xa198) "foo" { };
+register ditr_6 rw addr(base, 0xa19c) "foo" { };
+register dstat_6 rw addr(base, 0xa1a0) "foo" { };
+register dstatwb_lo_6 rw addr(base, 0xa1a4) "foo" { };
+register dstatwb_hi_6 rw addr(base, 0xa1a8) "foo" { };
+register dcherr_6 rw addr(base, 0xa1ac) "foo" { };
+register dcherrmsk_6 rw addr(base, 0xa1b0) "foo" { };
+register dcar_7 rw addr(base, 0xa1c0) "foo" { };
+register dhpr_7 rw addr(base, 0xa1c4) "foo" { };
+register dtpr_7 rw addr(base, 0xa1c8) "foo" { };
+register daux_lo_7 rw addr(base, 0xa1cc) "foo" { };
+register daux_hi_7 rw addr(base, 0xa1d0) "foo" { };
+register drar_lo_7 rw addr(base, 0xa1d4) "foo" { };
+register drar_hi_7 rw addr(base, 0xa1d8) "foo" { };
+register ditr_7 rw addr(base, 0xa1dc) "foo" { };
+register dstat_7 rw addr(base, 0xa1e0) "foo" { };
+register dstatwb_lo_7 rw addr(base, 0xa1e4) "foo" { };
+register dstatwb_hi_7 rw addr(base, 0xa1e8) "foo" { };
+register dcherr_7 rw addr(base, 0xa1ec) "foo" { };
+register dcherrmsk_7 rw addr(base, 0xa1f0) "foo" { };
+register dcr rw addr(base, 0xa280) "foo" { };
+register apicicr0 rw addr(base, 0xa9d0) "foo" { };
+register apicicr1 rw addr(base, 0xa9d8) "foo" { };
+register apicicr2 rw addr(base, 0xa9e0) "foo" { };
+register apicicr3 rw addr(base, 0xa9e8) "foo" { };
+register apicicr4 rw addr(base, 0xa9f0) "foo" { };
+register apicicr5 rw addr(base, 0xa9f8) "foo" { };
+register apicicr6 rw addr(base, 0xaa00) "foo" { };
+register apicicr7 rw addr(base, 0xaa08) "foo" { };
+register scratch0 rw addr(base, 0xab20) "foo" { };
+register scratch1 rw addr(base, 0xab24) "foo" { };
+register scratch2 rw addr(base, 0xab28) "foo" { };
+register scratch3 rw addr(base, 0xab2c) "foo" { };
+register scratch4 rw addr(base, 0xab30) "foo" { };
+register scratch5 rw addr(base, 0xab34) "foo" { };
+register scratch6 rw addr(base, 0xab38) "foo" { };
+register scratch7 rw addr(base, 0xab3c) "foo" { };
+register scratch8 rw addr(base, 0xab40) "foo" { };
+register scratch9 rw addr(base, 0xab44) "foo" { };
+register scratch10 rw addr(base, 0xab48) "foo" { };
+register scratch11 rw addr(base, 0xab4c) "foo" { };
+register scratch12 rw addr(base, 0xab50) "foo" { };
+register scratch13 rw addr(base, 0xab54) "foo" { };
+register scratch14 rw addr(base, 0xab58) "foo" { };
+register scratch15 rw addr(base, 0xab5c) "foo" { };
+register rdmasr0 rw addr(base, 0xb180) "foo" { };
+register sbq_flush rw addr(base, 0xb1a0 ) "foo" { };
+register tlb_flush rw addr(base, 0xb1a4) "foo" { };
+register gtt_phy_base rw addr(base, 0xc118) "foo" { };
+register emon_cnt0 rw addr(base, 0xcc28) "foo" { };
+register emon_cnt1 rw addr(base, 0xcc2c) "foo" { };
+register emon_cnt2 rw addr(base, 0xcc30) "foo" { };
+register emon_cnt3 rw addr(base, 0xcc34) "foo" { };
+};
cxxcompiler = "g++"
-ourCommonFlags = [ --Str "-m64",
+ourCommonFlags = [ Str "-m64",
Str "-mno-red-zone",
- Str "-fPIE",
+ -- Str "-fPIE",
+ Str "-fPIC",
Str "-fno-stack-protector",
Str "-Wno-unused-but-set-variable",
Str "-Wno-packed-bitfield-compat",
-- the intel mic architecture has no "normal" SIMD extensions
--- Str "-mno-mmx",
--- Str "-mno-sse",
+ Str "-fno-tree-vectorize",
+ Str "-mno-mmx",
+ Str "-mno-sse",
Str "-mno-sse2",
Str "-mno-sse3",
Str "-mno-sse4.1",
-- specific Xeon Phi architecture
-- Str "-Wa,-march=k1om",
-- Str "-Wa,-mtune=k1om",
- Str "-D__x86__" ]
+ Str "-D__x86__",
+ Str "-D__k1om__" ]
+
cFlags = ArchDefaults.commonCFlags
++ ArchDefaults.commonFlags
ourLdFlags = [ Str "-Wl,-z,max-page-size=0x1000",
-- Str "-Wl,-b,elf64-k1om",
-- Str "-Wl,--oformat,elf64-k1om",
- Str "-Wl,--build-id=none"]
- --Str "-m64"
+ Str "-Wl,--build-id=none",
+ Str "-m64" ]
ldFlags = ArchDefaults.ldFlags arch ++ ourLdFlags
kernelCFlags = [ Str s | s <- [ "-fno-builtin",
"-nostdinc",
"-std=c99",
+ "-m64",
"-mno-red-zone",
- "-fPIE",
+ -- "-fPIE",
+ "-fPIC",
+ "-e startup_64",
"-fno-stack-protector",
"-U__linux__",
+ "-D__k1om__",
"-Wall",
"-Wshadow",
"-Wstrict-prototypes",
"-Wno-unused-but-set-variable",
"-Werror",
"-imacros deputy/nodeputy.h",
+ "-fno-tree-vectorize",
"-mno-mmx",
"-mno-sse",
"-mno-sse2",
"-mno-sse3",
"-mno-sse4.1",
"-mno-sse4.2",
--- "-Wno-unused-but-set-variable",
"-mno-sse4",
"-mno-sse4a",
"-mno-3dnow" ] ]
kernelLdFlags = [ Str s | s <- [ "-Wl,-N",
--- "-Wl,-b,elf64-k1om",
+ --"-Wl,-b,elf64-k1om",
-- "-Wl,-A,k1om",
--- "-Wl,--oformat,elf64-k1om",
- "-pie",
+ --"-Wl,--oformat,elf64-k1om",
+ -- "-pie",
+ "-fPIC",
"-fno-builtin",
"-nostdlib",
- "-Wl,--fatal-warnings"] ]
--- "-m64"
+ "-Wl,--fatal-warnings",
+ "-m64" ] ]
------------------------------------------------------------------------
#
######################################################################
-k1om:
+# Intel Xeon Phi-specific modules
+XEON_PHI_MODULES =\
+ k1om/sbin/cpu
+
+menu.lst.k1om: $(SRCDIR)/hake/menu.lst.k1om
+ cp $< $@
+
+k1om: $(XEON_PHI_MODULES)
+ @echo "OK. Co Processor OS Built."
+ scp "k1om/sbin/cpu" emmentaler.ethz.ch:
+ ssh emmentaler.ethz.ch "scp cpu babybel.in.barrelfish.org:/root/cpu"
-.PHONY: k1om
#######################################################################
#
--
cpuDriver {
architectures = [ "k1om" ],
- assemblyFiles = [ "arch/x86_64/boot.S",
- "arch/x86_64/entry.S",
+ assemblyFiles = [ "arch/k1om/boot.S",
+ "arch/k1om/entry.S",
"arch/x86/init_ap_x86_64.S",
"arch/x86/init_ap_x86_32.S" ],
- cFiles = [ "arch/x86_64/debug.c",
- "arch/x86_64/gdb_arch.c",
- "arch/x86_64/init.c",
- "arch/x86_64/irq.c",
- "arch/x86_64/startup_arch.c",
- "arch/x86_64/exec.c",
- "arch/x86_64/syscall.c",
- "arch/x86_64/paging.c",
- "arch/x86_64/vmkit.c" ,
- "arch/x86_64/page_mappings_arch.c",
+ cFiles = [ "arch/k1om/debug.c",
+ "arch/k1om/gdb_arch.c",
+ "arch/k1om/init.c",
+ "arch/k1om/irq.c",
+ "arch/k1om/startup_arch.c",
+ "arch/k1om/exec.c",
+ "arch/k1om/syscall.c",
+ "arch/k1om/paging.c",
+ "arch/k1om/vmkit.c" ,
+ "arch/k1om/page_mappings_arch.c",
+ "arch/k1om/serial.c",
"arch/x86/apic.c",
"arch/x86/pic.c",
"arch/x86/start_aps.c",
"arch/x86/cmos.c",
"arch/x86/misc.c",
- "arch/x86/serial.c",
"arch/x86/multiboot.c",
"arch/x86/conio.c",
"arch/x86/syscall.c",
--
-- Generic Intel ia32 32-bit x86 core
--
- cpuDriver {
+ cpuDriver {
architectures = [ "x86_32" ],
assemblyFiles = [ "arch/x86_32/boot.S",
"arch/x86_32/entry.S",
-/**
- * \file
- * \brief Bootstrap the kernel.
+/* * Copyright (c) Intel Corporation (2011).
+*
+* Disclaimer: The codes contained in these modules may be specific to the
+* Intel Software Development Platform codenamed: Knights Ferry, and the
+* Intel product codenamed: Knights Corner, and are not backward compatible
+* with other Intel products. Additionally, Intel will NOT support the codes
+* or instruction set in future products.
+*
+* Intel offers no warranty of any kind regarding the code. This code is
+* licensed on an "AS IS" basis and Intel is not obligated to provide any support,
+* assistance, installation, training, or other services of any kind. Intel is
+* also not obligated to provide any updates, enhancements or extensions. Intel
+* specifically disclaims any warranty of merchantability, non-infringement,
+* fitness for any particular purpose, and any other warranty.
+*
+* Further, Intel disclaims all liability of any kind, including but not
+* limited to liability for infringement of any proprietary rights, relating
+* to the use of the code, even if Intel is notified of the possibility of
+* such liability. Except as expressly stated in an Intel license agreement
+* provided with this code and agreed upon with Intel, no license, express
+* or implied, by estoppel or otherwise, to any intellectual property rights
+* is granted herein.
+*/
+
+/*
+ * linux/boot/head.S
+ *
+ * Copyright (C) 1991, 1992, 1993 Linus Torvalds
*/
/*
- * Copyright (c) 2007, 2008, ETH Zurich.
- * All rights reserved.
+ * head.S contains the 32-bit startup code.
*
- * This file is distributed under the terms in the attached LICENSE file.
- * If you do not find this file, copies can be found by writing to:
- * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
+ * NOTE!!! Startup happens at absolute address 0x00001000, which is also where
+ * the page directory will exist. The startup code will be overwritten by
+ * the page directory. [According to comments etc elsewhere on a compressed
+ * kernel it will end up at 0x1000 + 1Mb I hope so as I assume this. - AC]
+ *
+ * Page 0 is deliberately kept safe, since System Management Mode code in
+ * laptops may need to access the BIOS data stored there. This is also
+ * useful for future device drivers that either access the BIOS via VM86
+ * mode.
+ */
+
+/*
+ * High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996
*/
#include <multiboot.h>
-#include <target/x86_64/offsets_target.h>
-
-/* The flags for the Multiboot header */
-#define MB_FLAGS (MULTIBOOT_HEADER_FLAG_MODS_PGALIGNED | MULTIBOOT_HEADER_FLAG_NEED_MEMINFO)
-
- .text
- .globl start, halt
- /* Multiboot header, 4-byte aligned */
- .align 4
- .long MULTIBOOT_HEADER_MAGIC /* magic */
- .long MB_FLAGS /* flags */
- .long -(MULTIBOOT_HEADER_MAGIC + MB_FLAGS) /* checksum */
-
-start:
- /* Initialize the stack pointer */
- lea (x86_64_kernel_stack + X86_64_KERNEL_STACK_SIZE)(%rip), %rsp
-
- /* Reset EFLAGS */
- pushq $0
- popf
-
- /* Enter architecture-specific init -- this should never return */
- movl %eax, %edi /* Multiboot magic value */
- movl %ebx, %esi /* Pointer to multiboot info struct */
- call arch_init
-
- /* Halt -- this should never be reached */
-halt: hlt
- jmp halt
+#include <target/k1om/offsets_target.h>
+ .code32
+ .text
+
+#define DECOMPRESS 0
+#define VERIFYCPU 0
+
+#define GDT_ENTRY_KERNEL_DS 3
+#define GDT_ENTRY_KERNEL_CS 2
+#define __KERNEL_DS (GDT_ENTRY_KERNEL_DS*8)
+#define __KERNEL_CS (GDT_ENTRY_KERNEL_CS*8)
+#define BOOT_STACK_SIZE 0x4000
+#define X86_CR4_PAE 0x00000020 /* enable physical address extensions */
+#define MSR_EFER 0xc0000080 /* extended feature register */
+#define _EFER_LME 8 /* Long mode enable */
+#define X86_CR0_PE 0x00000001 /* Protection Enable */
+#define X86_CR0_PG 0x80000000 /* Paging */
+
+#define BP_scratch 484 /* offsetof(struct boot_params, scratch) # */
+#define BP_loadflags 529 /* offsetof(struct boot_params, hdr.loadflags) # */
+#define BP_hardware_subarch 572 /* offsetof(struct boot_params, hdr.hardware_subarch) # */
+#define BP_version 518 /* offsetof(struct boot_params, hdr.version) # */
+#define BP_kernel_alignment 560 /* offsetof(struct boot_params, hdr.kernel_alignment) # */
+#define z_extract_offset 0
+#define LOAD_PHYSICAL_ADDR 0x1000000
+
+
+
+#ifndef LINKER_SCRIPT
+#define ALIGN __ALIGN
+#define ALIGN_STR __ALIGN_STR
+
+#ifndef ENTRY
+#define ENTRY(name) \
+ .globl name; \
+ .align 4,0x90; \
+ name:
+#endif
+#endif /* LINKER_SCRIPT */
+
+#ifndef WEAK
+#define WEAK(name) \
+ .weak name; \
+ name:
+#endif
+
+#ifndef END
+#define END(name) \
+ .size name, .-name
+#endif
+
+/* If symbol 'name' is treated as a subroutine (gets called, and returns)
+ * then please use ENDPROC to mark 'name' as STT_FUNC for the benefit of
+ * static analysis tools such as stack depth analyzer.
+ */
+#ifndef ENDPROC
+#define ENDPROC(name) \
+ .type name, @function; \
+ END(name)
+#endif
+
+
+ .section ".head.text","ax"
+ .code32
+ENTRY(startup_32)
+ cld
+ /*
+ * Test KEEP_SEGMENTS flag to see if the bootloader is asking
+ * us to not reload segments
+ */
+ testb $(1<<6), BP_loadflags(%esi)
+ jnz 1f
+
+ cli
+ movl $(__KERNEL_DS), %eax
+ movl %eax, %ds
+ movl %eax, %es
+ movl %eax, %ss
+1:
+
+/*
+ * Calculate the delta between where we were compiled to run
+ * at and where we were actually loaded at. This can only be done
+ * with a short local call on x86. Nothing else will tell us what
+ * address we are running at. The reserved chunk of the real-mode
+ * data at 0x1e4 (defined as a scratch field) are used as the stack
+ * for this calculation. Only 4 bytes are needed.
+ */
+ leal (BP_scratch+4)(%esi), %esp
+ call 1f
+1: popl %ebp
+ subl $1b, %ebp
+
+/* setup a stack and make sure cpu supports long mode. */
+ movl $boot_stack_end, %eax
+ addl %ebp, %eax
+ movl %eax, %esp
+/*
+ * verify_cpu returns 0 if the CPU supports long mode & SSE
+ * ML1OM & MK1OM support long mode, but not SSE
+ */
+#ifndef VERIFYCPU
+ call verify_cpu
+ testl %eax, %eax
+ jnz no_longmode
+#endif
+
+/*
+ * Compute the delta between where we were compiled to run at
+ * and where the code will actually run at.
+ *
+ * %ebp contains the address we are loaded at by the boot loader and %ebx
+ * contains the address where we should move the kernel image temporarily
+ * for safe in-place decompression.
+ */
+ movl $LOAD_PHYSICAL_ADDR, %ebx
+
+ /* Target address to relocate to for decompression */
+ addl $z_extract_offset, %ebx
+
+
+/*
+ * Prepare for entering 64 bit mode
+ */
+
+ /* Load new GDT with the 64bit segments using 32bit descriptor */
+ leal gdt(%ebp), %eax
+ movl %eax, gdt+2(%ebp)
+ lgdt gdt(%ebp)
+
+ /* Enable PAE mode */
+ movl $(X86_CR4_PAE), %eax
+ movl %eax, %cr4
+
+ /*
+ * Build early 4G boot pagetable
+ */
+ /* Initialize Page tables to 0 */
+ leal pgtable(%ebx), %edi
+ xorl %eax, %eax
+ movl $((4096*6)/4), %ecx
+ rep stosl
+
+ /* Build Level 4 */
+ leal pgtable + 0(%ebx), %edi
+ leal 0x1007 (%edi), %eax
+ movl %eax, 0(%edi)
+
+ /* Build Level 3 */
+ leal pgtable + 0x1000(%ebx), %edi
+ leal 0x1007(%edi), %eax
+ movl $4, %ecx
+1: movl %eax, 0x00(%edi)
+ addl $0x00001000, %eax
+ addl $8, %edi
+ decl %ecx
+ jnz 1b
+
+ /* Build Level 2 */
+ leal pgtable + 0x2000(%ebx), %edi
+ movl $0x00000183, %eax
+ movl $2048, %ecx
+1: movl %eax, 0(%edi)
+ addl $0x00200000, %eax
+ addl $8, %edi
+ decl %ecx
+ jnz 1b
+
+ /* TO SUPPORT "Serial" out */
+
+ /* Build Level 3 */
+ leal pgtable + 0x1000(%ebx), %edi
+ leal 0x5007(%edi), %eax
+ addl $256, %edi //31st entry
+ movl %eax, 0x00(%edi)
+
+ /* Build Level 2 */
+ leal pgtable + 0x6000(%ebx), %edi
+ movl $0x00000183, %eax
+ movl $512, %ecx
+1: movl %eax, 0(%edi)
+ addl $0x00200000, %eax
+ addl $8, %edi
+ decl %ecx
+ jnz 1b
+
+ /* Build Level 2 - high part*/
+ leal pgtable + 0x6000(%ebx), %edi
+ addl $4, %edi
+ movl $512, %ecx
+1: movl $0x8, 0(%edi)
+ addl $8, %edi
+ decl %ecx
+ jnz 1b
+
+
+ /* Enable the boot page tables */
+ leal pgtable(%ebx), %eax
+ movl %eax, %cr3
+
+ /* Enable Long mode in EFER (Extended Feature Enable Register) */
+ movl $MSR_EFER, %ecx
+ rdmsr
+ btsl $_EFER_LME, %eax
+ wrmsr
+
+ /*
+ * Setup for the jump to 64bit mode
+ *
+ * When the jump is performend we will be in long mode but
+ * in 32bit compatibility mode with EFER.LME = 1, CS.L = 0, CS.D = 1
+ * (and in turn EFER.LMA = 1). To jump into 64bit mode we use
+ * the new gdt/idt that has __KERNEL_CS with CS.L = 1.
+ * We place all of the values on our mini stack so lret can
+ * used to perform that far jump.
+ */
+ pushl $__KERNEL_CS
+ leal startup_64(%ebp), %eax
+ pushl %eax
+
+ /* Enter paged protected Mode, activating Long Mode */
+ movl $(X86_CR0_PG | X86_CR0_PE), %eax /* Enable Paging and Protected mode */
+ movl %eax, %cr0
+
+ /* Jump from 32bit compatibility mode into 64bit mode. */
+ lret
+ENDPROC(startup_32)
+
+no_longmode:
+ /* This isn't an x86-64 CPU so hang */
+1:
+ hlt
+ jmp 1b
+
+#if VERIFYCPU
+#include "../../kernel/verify_cpu.S"
+#endif
+ /*
+ * Be careful here startup_64 needs to be at a predictable
+ * address so I can export it in an ELF header. Bootloaders
+ * should look at the ELF header to find this address, as
+ * it may change in the future.
+ */
+ .code64
+ .org 0x400
+ENTRY(startup_64)
+ /*
+ * We come here either from startup_32 or directly from a
+ * 64bit bootloader. If we come here from a bootloader we depend on
+ * an identity mapped page table being provied that maps our
+ * entire text+data+bss and hopefully all of memory.
+ */
+
+ /* Setup data segments. */
+ xorl %eax, %eax
+ movl %eax, %ds
+ movl %eax, %es
+ movl %eax, %ss
+ movl %eax, %fs
+ movl %eax, %gs
+ lldt %ax
+ movl $0x20, %eax
+ ltr %ax
+
+#if 0
+ /*
+ * Compute the decompressed kernel start address. It is where
+ * we were loaded at aligned to a 2M boundary. %rbp contains the
+ * decompressed kernel start address.
+ *
+ * If it is a relocatable kernel then decompress and run the kernel
+ * from load address aligned to 2MB addr, otherwise decompress and
+ * run the kernel from LOAD_PHYSICAL_ADDR
+ *
+ * We cannot rely on the calculation done in 32-bit mode, since we
+ * may have been invoked via the 64-bit entry point.
+ */
+
+ /* Start with the delta to where the kernel will run at. */
+ movq $LOAD_PHYSICAL_ADDR, %rbp
+
+ /* Target address to relocate to for decompression */
+ leaq z_extract_offset(%rbp), %rbx
+
+ /* Set up the stack */
+ leaq boot_stack_end(%rbx), %rsp
+
+ /* Zero EFLAGS */
+ pushq $0
+ popfq
+
+
+/*
+ * Copy the compressed kernel to the end of our buffer
+ * where decompression in place becomes safe.
+ */
+ #if 1
+ pushq %rsi
+ leaq (_bss-8)(%rip), %rsi
+ leaq (_bss-8)(%rbx), %rdi
+ movq $_bss /* - $startup_32 */, %rcx
+ shrq $3, %rcx
+ std
+ rep movsq
+ cld
+ popq %rsi
+#endif
+
+#if 1
+ movabsq $0x08007DAB5C, %r14
+ movl $0x0A52503E, (%r14)
+ movabsq $0x08007DAB40, %r14
+ movl $2054847098, (%r14)
+#endif
+
+
+/*
+ * Jump to the relocated address.
+ */
+ leaq relocated(%rbx), %rax
+ jmp *%rax
+
+ .text
+relocated:
+
+#endif
+
+/*
+ * Clear BSS (stack is currently empty)
+ */
+ xorl %eax, %eax
+ leaq _bss(%rip), %rdi
+ leaq _ebss(%rip), %rcx
+ subq %rdi, %rcx
+ shrq $3, %rcx
+ rep stosq
+
+/*
+ * Adjust our own GOT
+ */
+ leaq _got(%rip), %rdx
+ leaq _egot(%rip), %rcx
+1:
+ cmpq %rcx, %rdx
+ jae 2f
+ addq %rbx, (%rdx)
+ addq $8, %rdx
+ jmp 1b
+2:
+
+
+ /* Reset EFLAGS */
+ pushq $0
+ popf
+
+ lea (x86_64_kernel_stack + X86_64_KERNEL_STACK_SIZE)(%rip), %rsp
+
+ movl %eax, %edi /* Multiboot magic value */
+ movl %ebx, %esi /* Pointer to multiboot info struct */
+
+
+#if 1
+ movabsq $0x08007DAB5C, %r14
+ movl $0x0A58553E, (%r14)
+ movabsq $0x08007DAB40, %r14
+ movl $2054847098, (%r14)
+#endif
+
+
+ call arch_init
+
+ // jmp *%rbp
+
+ /* Halt -- this should never be reached */
+ENTRY(halt)
+ hlt
+ jmp halt
+
+
+ .data
+gdt:
+ .word gdt_end - gdt
+ .long gdt
+ .word 0
+ .quad 0x0000000000000000 /* NULL descriptor */
+ .quad 0x00af9a000000ffff /* __KERNEL_CS */
+ .quad 0x00cf92000000ffff /* __KERNEL_DS */
+ .quad 0x0080890000000000 /* TS descriptor */
+ .quad 0x0000000000000000 /* TS continued */
+gdt_end:
+
+/*
+ * Stack and heap for uncompression
+ */
+ .bss
+ .balign 4
+#if DECOMPRESS
+boot_heap:
+ .fill BOOT_HEAP_SIZE, 1, 0
+#endif
+boot_stack:
+ .fill BOOT_STACK_SIZE, 1, 0
+boot_stack_end:
+
+/*
+ * Space for page tables (not in .bss so not zeroed)
+ */
+ .section ".pgtable","a",@nobits
+ .balign 4096
+pgtable:
+ .fill 7*4096, 1, 0
#include <arch/x86/startup_x86.h>
#include <arch/x86/ipi_notify.h>
#include <barrelfish_kpi/cpu_arch.h>
-#include <target/x86_64/barrelfish_kpi/cpu_target.h>
+#include <target/k1om/barrelfish_kpi/cpu_target.h>
+#include <linux_host.h>
#include <dev/xapic_dev.h> // XXX
#include <dev/ia32_dev.h>
*
* This is the one and only kernel stack for a kernel instance.
*/
-uintptr_t x86_64_kernel_stack[X86_64_KERNEL_STACK_SIZE/sizeof(uintptr_t)];
+uintptr_t x86_64_kernel_stack[X86_64_KERNEL_STACK_SIZE / sizeof(uintptr_t)];
/**
* \brief Global Task State Segment (TSS).
* turned off in 64-bit mode. They map flat-mode code and stack segments for
* both kernel- and user-space and the only Task State Segment (TSS).
*/
-union segment_descriptor gdt[] __attribute__ ((aligned (4))) = {
- [NULL_SEL] = { // Null segment
- .raw = 0
- },
- [KCODE_SEL] = { // Kernel code segment
+union segment_descriptor gdt[] __attribute__ ((aligned (4))) = { [NULL_SEL] = { // Null segment
+ .raw = 0 }, [KCODE_SEL] = { // Kernel code segment
.d = {
.lo_limit = 0xffff,
.lo_base = 0,
.long_mode = 1,
.operation_size = 0,
.granularity = 1,
- .hi_base = 0
- }
- },
- [KSTACK_SEL] = { // Kernel stack segment
+ .hi_base = 0 } }, [KSTACK_SEL] = { // Kernel stack segment
.d = {
.lo_limit = 0xffff,
.lo_base = 0,
.long_mode = 1,
.operation_size = 0,
.granularity = 1,
- .hi_base = 0
- }
- },
- [USTACK_SEL] = { // User stack segment
+ .hi_base = 0 } }, [USTACK_SEL] = { // User stack segment
.d = {
.lo_limit = 0xffff,
.lo_base = 0,
.long_mode = 1,
.operation_size = 0,
.granularity = 1,
- .hi_base = 0
- }
- },
- [UCODE_SEL] = { // User code segment
+ .hi_base = 0 } }, [UCODE_SEL] = { // User code segment
.d = {
.lo_limit = 0xffff,
.lo_base = 0,
.long_mode = 1,
.operation_size = 0,
.granularity = 1,
- .hi_base = 0
- }
- },
- [TSS_LO_SEL] = { // Global Task State Segment (TSS), lower 8 bytes
+ .hi_base = 0 } }, [TSS_LO_SEL] = { // Global Task State Segment (TSS), lower 8 bytes
.sys_lo = {
.lo_limit = sizeof(tss) & 0xffff,
.type = SDT_SYSTSS,
.present = 1,
.hi_limit = (sizeof(tss) >> 16) & 0xf,
.available = 0,
- .granularity = 0,
- }
- },
- [TSS_HI_SEL] = { // Global Task State Segment (TSS), upper 8 bytes
- .sys_hi = {
- .base = 0
- }
- },
- [LDT_LO_SEL] = { // Local descriptor table (LDT), lower 8 bytes
- .sys_lo = {
- .lo_limit = 0, // # 4k pages (since granularity = 1)
- .lo_base = 0, // changed by context switch path when doing lldt
- .type = 2, // LDT
+ .granularity = 0, } }, [TSS_HI_SEL] = { // Global Task State Segment (TSS), upper 8 bytes
+ .sys_hi = { .base = 0 } }, [LDT_LO_SEL] = { // Local descriptor table (LDT), lower 8 bytes
+ .sys_lo = { .lo_limit = 0, // # 4k pages (since granularity = 1)
+ .lo_base = 0, // changed by context switch path when doing lldt
+ .type = 2, // LDT
.privilege_level = SEL_UPL,
.present = 1,
.hi_limit = 0,
.available = 0,
.granularity = 1,
- .hi_base = 0
- }
- },
- [LDT_HI_SEL] = { // Local descriptor table (LDT), upper 8 bytes
- .sys_hi = {
- .base = 0 // changed by context switch path when doing lldt
- }
- },
-};
+ .hi_base = 0 } }, [LDT_HI_SEL ] = { // Local descriptor table (LDT), upper 8 bytes
+ .sys_hi = { .base = 0 // changed by context switch path when doing lldt
+ } }, };
union segment_descriptor *ldt_descriptor = &gdt[LDT_LO_SEL];
* Bootup PML4, used to map both low (identity-mapped) memory and relocated
* memory at the same time.
*/
-static union x86_64_pdir_entry boot_pml4[PTABLE_SIZE]
-__attribute__ ((aligned(BASE_PAGE_SIZE)));
+static union x86_64_pdir_entry boot_pml4[PTABLE_SIZE] __attribute__ ((aligned(BASE_PAGE_SIZE)));
/**
* Bootup low-map PDPT and hi-map PDPT.
*/
-static union x86_64_pdir_entry boot_pdpt[PTABLE_SIZE]
-__attribute__ ((aligned(BASE_PAGE_SIZE))),
- boot_pdpt_hi[PTABLE_SIZE] __attribute__ ((aligned(BASE_PAGE_SIZE)));
+static union x86_64_pdir_entry
+ boot_pdpt[PTABLE_SIZE] __attribute__ ((aligned(BASE_PAGE_SIZE))),
+ boot_pdpt_hi[PTABLE_SIZE] __attribute__ ((aligned(BASE_PAGE_SIZE)));
/**
* Bootup low-map PDIR, hi-map PDIR, and 1GB PDIR.
*/
-static union x86_64_ptable_entry boot_pdir[PTABLE_SIZE]
-__attribute__ ((aligned(BASE_PAGE_SIZE))),
- boot_pdir_hi[PTABLE_SIZE] __attribute__ ((aligned(BASE_PAGE_SIZE))),
- boot_pdir_1GB[PTABLE_SIZE] __attribute__ ((aligned(BASE_PAGE_SIZE)));
+static union x86_64_ptable_entry
+ boot_pdir[PTABLE_SIZE] __attribute__ ((aligned(BASE_PAGE_SIZE))),
+ boot_pdir_hi[PTABLE_SIZE] __attribute__ ((aligned(BASE_PAGE_SIZE))),
+ boot_pdir_1GB[PTABLE_SIZE] __attribute__ ((aligned(BASE_PAGE_SIZE)));
/**
* This flag is set to true once the IDT is initialized and exceptions can be
* \param base Start address of kernel image in physical address space.
* \param size Size of kernel image.
*/
-static void paging_init(lpaddr_t base, size_t size)
+static void
+paging_init(lpaddr_t base,
+ size_t size)
{
lvaddr_t vbase = local_phys_to_mem(base);
// Align base to kernel page size
- if(base & X86_64_MEM_PAGE_MASK) {
+ if (base & X86_64_MEM_PAGE_MASK) {
size += base & X86_64_MEM_PAGE_MASK;
base -= base & X86_64_MEM_PAGE_MASK;
}
// Align vbase to kernel page size
- if(vbase & X86_64_MEM_PAGE_MASK) {
+ if (vbase & X86_64_MEM_PAGE_MASK) {
vbase -= vbase & X86_64_MEM_PAGE_MASK;
}
// Align size to kernel page size
- if(size & X86_64_MEM_PAGE_MASK) {
+ if (size & X86_64_MEM_PAGE_MASK) {
size += X86_64_MEM_PAGE_SIZE - (size & X86_64_MEM_PAGE_MASK);
}
// XXX: Cannot currently map more than one table of pages
assert(size <= X86_64_MEM_PAGE_SIZE * X86_64_PTABLE_SIZE);
-/* assert(size <= MEM_PAGE_SIZE); */
+ /* assert(size <= MEM_PAGE_SIZE); */
- for(size_t i = 0; i < size; i += X86_64_MEM_PAGE_SIZE,
- base += X86_64_MEM_PAGE_SIZE, vbase += X86_64_MEM_PAGE_SIZE) {
+ for (size_t i = 0; i < size; i += X86_64_MEM_PAGE_SIZE, base +=
+ X86_64_MEM_PAGE_SIZE, vbase += X86_64_MEM_PAGE_SIZE) {
// No kernel image above 4 GByte
- assert(base < ((lpaddr_t)4 << 30));
+ assert(base < ((lpaddr_t )4 << 30));
// Identity-map the kernel's physical region, so we don't lose ground
- paging_x86_64_map_table(&boot_pml4[X86_64_PML4_BASE(base)], (lpaddr_t)boot_pdpt);
- paging_x86_64_map_table(&boot_pdpt[X86_64_PDPT_BASE(base)], (lpaddr_t)boot_pdir);
- paging_x86_64_map_large(&boot_pdir[X86_64_PDIR_BASE(base)], base, PTABLE_PRESENT
- | PTABLE_READ_WRITE | PTABLE_USER_SUPERVISOR);
+ paging_x86_64_map_table(&boot_pml4[X86_64_PML4_BASE(base)],
+ (lpaddr_t) boot_pdpt);
+ paging_x86_64_map_table(&boot_pdpt[X86_64_PDPT_BASE(base)],
+ (lpaddr_t) boot_pdir);
+ paging_x86_64_map_large(
+ &boot_pdir[X86_64_PDIR_BASE(base)], base,
+ PTABLE_PRESENT | PTABLE_READ_WRITE | PTABLE_USER_SUPERVISOR);
// Alias the same region at MEMORY_OFFSET
- paging_x86_64_map_table(&boot_pml4[X86_64_PML4_BASE(vbase)], (lpaddr_t)boot_pdpt_hi);
- paging_x86_64_map_table(&boot_pdpt_hi[X86_64_PDPT_BASE(vbase)], (lpaddr_t)boot_pdir_hi);
- paging_x86_64_map_large(&boot_pdir_hi[X86_64_PDIR_BASE(vbase)], base, PTABLE_PRESENT
- | PTABLE_READ_WRITE | PTABLE_USER_SUPERVISOR);
+ paging_x86_64_map_table(&boot_pml4[X86_64_PML4_BASE(vbase)],
+ (lpaddr_t) boot_pdpt_hi);
+ paging_x86_64_map_table(&boot_pdpt_hi[X86_64_PDPT_BASE(vbase)],
+ (lpaddr_t) boot_pdir_hi);
+ paging_x86_64_map_large(
+ &boot_pdir_hi[X86_64_PDIR_BASE(vbase)], base,
+ PTABLE_PRESENT | PTABLE_READ_WRITE | PTABLE_USER_SUPERVISOR);
}
// Identity-map the first 1G of physical memory for bootloader data
- paging_x86_64_map_table(&boot_pml4[0], (lpaddr_t)boot_pdpt);
- paging_x86_64_map_table(&boot_pdpt[0], (lpaddr_t)boot_pdir_1GB);
+ paging_x86_64_map_table(&boot_pml4[0], (lpaddr_t) boot_pdpt);
+ paging_x86_64_map_table(&boot_pdpt[0], (lpaddr_t) boot_pdir_1GB);
for (int i = 0; i < X86_64_PTABLE_SIZE; i++) {
- paging_x86_64_map_large(&boot_pdir_1GB[X86_64_PDIR_BASE(X86_64_MEM_PAGE_SIZE * i)],
- X86_64_MEM_PAGE_SIZE * i, PTABLE_PRESENT
- | PTABLE_READ_WRITE | PTABLE_USER_SUPERVISOR);
+ paging_x86_64_map_large(
+ &boot_pdir_1GB[X86_64_PDIR_BASE(X86_64_MEM_PAGE_SIZE * i)],
+ X86_64_MEM_PAGE_SIZE * i,
+ PTABLE_PRESENT | PTABLE_READ_WRITE | PTABLE_USER_SUPERVISOR);
}
// Activate new page tables
- paging_x86_64_context_switch((lpaddr_t)boot_pml4);
+ paging_x86_64_context_switch((lpaddr_t) boot_pml4);
}
/**
* Finally, completes setup of GDT to include TSS base address mapping and
* loads TSS into task register.
*/
-static void gdt_reset(void)
+static void
+gdt_reset(void)
{
- lvaddr_t ptss = (lvaddr_t)&tss;
- struct region_descriptor region = {
- .rd_limit = sizeof(gdt),
- .rd_base = (uint64_t)&gdt
- };
+ lvaddr_t ptss = (lvaddr_t) &tss;
+ struct region_descriptor region = { .rd_limit = sizeof(gdt), .rd_base =
+ (uint64_t) &gdt };
// Load default GDT
__asm volatile("lgdt %[region]" :: [region] "m" (region));
// Reload segments
__asm volatile("mov %[null], %%ds \n\t"
- "mov %[null], %%es \n\t"
- "mov %[ss], %%ss \n\t"
- "mov %[null], %%gs \n\t"
- "mov %[null], %%fs \n\t"
- "pushq %[cs] \n\t" // new CS
- "lea 1f(%%rip), %%rax \n\t" // jumps to after lret
- "pushq %%rax \n\t" // new IP
- "lretq \n\t" // fake return
- "1: \n\t" // we'll continue here
- : /* No Output */
- :
- [null] "r" (0),
- [ss] "r" (GSEL(KSTACK_SEL, SEL_KPL)),
- [cs] "i" (GSEL(KCODE_SEL, SEL_KPL))
- : "rax"
- );
+ "mov %[null], %%es \n\t"
+ "mov %[ss], %%ss \n\t"
+ "mov %[null], %%gs \n\t"
+ "mov %[null], %%fs \n\t"
+ "pushq %[cs] \n\t" // new CS
+ "lea 1f(%%rip), %%rax \n\t"// jumps to after lret
+ "pushq %%rax \n\t"// new IP
+ "lretq \n\t"// fake return
+ "1: \n\t"// we'll continue here
+ : /* No Output */
+ :
+ [null] "r" (0),
+ [ss] "r" (GSEL(KSTACK_SEL, SEL_KPL)),
+ [cs] "i" (GSEL(KCODE_SEL, SEL_KPL))
+ : "rax"
+ );
// Complete setup of TSS descriptor (by inserting base address of TSS)
gdt[TSS_LO_SEL].sys_lo.lo_base = ptss & 0xffffff;
gdt[TSS_HI_SEL].sys_hi.base = ptss >> 32;
// Complete setup of TSS
- tss.rsp[0] = (lvaddr_t)&x86_64_kernel_stack[X86_64_KERNEL_STACK_SIZE / sizeof(uintptr_t)];
+ tss.rsp[0] = (lvaddr_t) &x86_64_kernel_stack[X86_64_KERNEL_STACK_SIZE
+ / sizeof(uintptr_t)];
// Load task state register
__asm volatile("ltr %%ax" :: "a" (GSEL(TSS_LO_SEL, SEL_KPL)));
relocate_stack(lvaddr_t offset)
{
__asm volatile("add %[stack], %%rsp\n\t"
- : /* No output */
- : [stack] "er" (offset)
- : "rsp"
- );
+ : /* No output */
+ : [stack] "er" (offset)
+ : "rsp"
+ );
}
/**
* user-space base selector and RFLAGS mask for SYSCALL/SYSRET fast system
* calls.
*/
-static inline void enable_fast_syscalls(void)
+static inline void
+enable_fast_syscalls(void)
{
// Segment selector bases for both kernel- and user-space for fast
- // system calls
+ // system calls
ia32_star_t star = ia32_star_rd(NULL);
- star = ia32_star_call_insert(star, GSEL(KCODE_SEL, SEL_KPL));
- star = ia32_star_ret_insert( star, GSEL(KSTACK_SEL, SEL_UPL));
+ star = ia32_star_call_insert(star, GSEL(KCODE_SEL, SEL_KPL));
+ star = ia32_star_ret_insert(star, GSEL(KSTACK_SEL, SEL_UPL));
ia32_star_wr(NULL, star);
// Set ia32_lstar MSR to point to kernel-space system call multiplexer
- ia32_lstar_wr(NULL, (lvaddr_t)syscall_entry);
+ ia32_lstar_wr(NULL, (lvaddr_t) syscall_entry);
// Set IA32_FMASK MSR for our OSes EFLAGS mask
// We mask out everything (including interrupts).
- ia32_fmask_v_wrf(NULL, ~(RFLAGS_ALWAYS1) );
+ ia32_fmask_v_wrf(NULL, ~(RFLAGS_ALWAYS1));
// Enable fast system calls
ia32_efer_sce_wrf(NULL, 1);
}
-static inline void enable_tlb_flush_filter(void)
+static inline void
+enable_tlb_flush_filter(void)
{
uint32_t eax, ebx, ecx, edx;
// Must read "AuthenticAMD"
cpuid(0, &eax, &ebx, &ecx, &edx);
- if(ebx != 0x68747541 || ecx != 0x444d4163 || edx != 0x69746e65) {
+ if (ebx != 0x68747541 || ecx != 0x444d4163 || edx != 0x69746e65) {
return;
}
// Is at least family 0fh?
cpuid(1, &eax, &ebx, &ecx, &edx);
- if(((eax >> 8) & 0xf) != 0xf) {
+ if (((eax >> 8) & 0xf) != 0xf) {
return;
}
ia32_amd_hwcr_ffdis_wrf(NULL, 1);
}
-static inline void enable_monitor_mwait(void)
+static inline void
+enable_monitor_mwait(void)
{
uint32_t eax, ebx, ecx, edx;
* calls kernel_startup(), which should not return (if it does, this function
* halts the kernel).
*/
-static void __attribute__ ((noreturn, noinline)) text_init(void)
+static void __attribute__ ((noreturn, noinline))
+text_init(void)
{
// Reset global and locks to point to the memory in the pristine image
- global = (struct global*)addr_global;
+ global = (struct global*) addr_global;
/*
* Reset paging once more to use relocated data structures and map in
paging_x86_64_reset();
// Relocate global to "memory"
- global = (struct global*)local_phys_to_mem((lpaddr_t)global);
+ global = (struct global*) local_phys_to_mem((lpaddr_t) global);
// Relocate glbl_core_data to "memory"
- glbl_core_data = (struct x86_core_data *)
- local_phys_to_mem((lpaddr_t)glbl_core_data);
+ glbl_core_data = (struct x86_core_data *) local_phys_to_mem(
+ (lpaddr_t) glbl_core_data);
/*
* Use new physical address space for video memory -- no calls to functions
// Re-map physical memory
/* XXX: Currently we are statically mapping a fixed amount of
- memory. We should not map in more memory than the machine
- actually has. Or else if the kernel tries to access addresses
- not backed by real memory, it will experience weird faults
- instead of a simpler pagefault.
-
- Ideally, we should use the ACPI information to figure out which
- memory to map in. Look at ticket #218 for more
- information. -Akhi
- */
- if(paging_x86_64_map_memory(0, X86_64_PADDR_SPACE_LIMIT) != 0) {
+ memory. We should not map in more memory than the machine
+ actually has. Or else if the kernel tries to access addresses
+ not backed by real memory, it will experience weird faults
+ instead of a simpler pagefault.
+
+ Ideally, we should use the ACPI information to figure out which
+ memory to map in. Look at ticket #218 for more
+ information. -Akhi
+ */
+ if (paging_x86_64_map_memory(0, X86_64_PADDR_SPACE_LIMIT) != 0) {
panic("error while mapping physical memory!");
}
// do not remove/change this printf: needed by regression harness
printf("Barrelfish CPU driver starting on x86_64 apic_id %u\n", apic_id);
- if(apic_is_bsp()) {
+ if (apic_is_bsp()) {
// Initialize classic (8259A) PIC
pic_init();
}
if (kernel_ticks_enabled) {
timing_calibrate();
bool periodic = true;
- #ifdef CONFIG_ONESHOT_TIMER
+#ifdef CONFIG_ONESHOT_TIMER
// we probably need a global variable like kernel_ticks_enabled
periodic = false;
- #endif
+#endif
apic_timer_init(false, periodic);
timing_apic_timer_set_ms(kernel_timeslice);
} else {
// Returning here will crash! -- low pages not mapped anymore!
}
+
+
/**
* \brief Architecture-specific initialization function.
*
* \param magic Boot magic value
* \param pointer Pointer to Multiboot Info or to Global structure
*/
-void arch_init(uint64_t magic, void *pointer)
+void
+arch_init(uint64_t magic,
+ void *pointer)
{
// Sanitize the screen
- conio_cls();
+ //conio_cls();
serial_console_init();
- panic("Hello World!\n");
+ notify_host();
+
+ /* we do not have multiboot */
+
+ void __attribute__ ((noreturn))
+ (*reloc_text_init)(void) =
+ (void *)local_phys_to_mem((lpaddr_t)text_init);
+
- void __attribute__ ((noreturn)) (*reloc_text_init)(void) =
- (void *)local_phys_to_mem((lpaddr_t)text_init);
struct Elf64_Shdr *rela, *symtab;
struct multiboot_info *mb = NULL;
* known. Otherwise the passed value should equal the original structure.
* If magic value does not match what we expect, we cannot proceed safely.
*/
- switch(magic) {
+ switch (magic) {
case MULTIBOOT_INFO_MAGIC:
- mb = (struct multiboot_info *)pointer;
+ mb = (struct multiboot_info *) pointer;
// Construct the global structure and store its address to retrive it
// across relocation
memset(&global->locks, 0, sizeof(global->locks));
- addr_global = (uint64_t)global;
+ addr_global = (uint64_t) global;
break;
case KERNEL_BOOT_MAGIC:
- global = (struct global*)pointer;
+ global = (struct global*) pointer;
// Store the address of global to retrive it across relocation
- addr_global = (uint64_t)global;
+ addr_global = (uint64_t) global;
break;
default:
- panic("Magic value does not match! (0x%x != 0x%lx != 0x%x)",
- KERNEL_BOOT_MAGIC, magic, MULTIBOOT_INFO_MAGIC);
+ addr_global = (uint64_t) global;
break;
}
+
/* determine page-aligned physical address past end of multiboot */
- lvaddr_t dest = (lvaddr_t)&_start_kernel;
+ lvaddr_t dest = (lvaddr_t) &_start_kernel;
if (dest & (BASE_PAGE_SIZE - 1)) {
dest &= ~(BASE_PAGE_SIZE - 1);
dest += BASE_PAGE_SIZE;
}
+ printf("Welcome to Barrelfish\n");
+
// XXX: print kernel address for debugging with gdb
- printf("Kernel starting at address 0x%"PRIxLVADDR"\n",
- local_phys_to_mem(dest));
+// printf("Kernel starting at address 0x%"PRIxLVADDR"\n", local_phys_to_mem(dest));
+
+ printf("Hi there!\n");
struct x86_coredata_elf *elf;
uint32_t multiboot_flags;
if (mb != NULL) { /* Multiboot info was passed */
multiboot_flags = mb->flags;
- elf = (struct x86_coredata_elf *)&mb->syms.elf;
+ elf = (struct x86_coredata_elf *) &mb->syms.elf;
// We need the ELF section header table for relocation
if (!(multiboot_flags & MULTIBOOT_INFO_FLAG_HAS_ELF_SYMS)) {
}
// Determine where free RAM starts
- glbl_core_data->start_free_ram =
- ROUND_UP(max(multiboot_end_addr(mb), (uintptr_t)&_end_kernel),
- BASE_PAGE_SIZE);
+ glbl_core_data->start_free_ram = ROUND_UP(
+ max(multiboot_end_addr(mb), (uintptr_t)&_end_kernel),
+ BASE_PAGE_SIZE);
glbl_core_data->mods_addr = mb->mods_addr;
glbl_core_data->mods_count = mb->mods_count;
glbl_core_data->mmap_length = mb->mmap_length;
glbl_core_data->mmap_addr = mb->mmap_addr;
} else { /* No multiboot info, use the core_data struct */
- struct x86_core_data *core_data =
- (struct x86_core_data*)(dest - BASE_PAGE_SIZE);
+
+ printf("No multiboot \n");
+
+ struct x86_core_data *core_data = (struct x86_core_data*) (dest
+ - BASE_PAGE_SIZE);
multiboot_flags = core_data->multiboot_flags;
elf = &core_data->elf;
glbl_core_data = core_data;
- core_data->cmdline = (lpaddr_t)&core_data->kernel_cmdline;
+ core_data->cmdline = (lpaddr_t) &core_data->kernel_cmdline;
my_core_id = core_data->dst_core_id;
if (core_data->module_end > 4ul * (1ul << 20)) {
" Either move the module or increase initial mapping.");
}
}
+ printf("Continuing... \n");
+
+
+ if (!elf) {
+ printf("ELF is null.Continuing... \n");
+ while(1)
+ ;
+ }
+
+ printf("Elf non null.. go ahead\n");
+
+ printf("testing....\n");
+ printf("1+2=%d\n", 1+2);
// We're only able to process Elf64_Rela entries
if (elf->size != sizeof(struct Elf64_Shdr)) {
+ printf("ELF section header entry size mismatch!\n");
+ while(1)
+ ;
panic("ELF section header entry size mismatch!");
}
+ printf("Continuing... 2\n");
+
// Find relocation section
- rela = elf64_find_section_header_type((struct Elf64_Shdr *)
- (lpaddr_t)elf->addr,
+ rela = elf64_find_section_header_type((struct Elf64_Shdr *) (lpaddr_t) elf->addr,
elf->num, SHT_RELA);
if (rela == NULL) {
panic("Kernel image does not include relocation section!");
}
+ printf("Continuing... 3\n");
+
// Find symbol table section
- symtab = elf64_find_section_header_type((struct Elf64_Shdr *)
- (lpaddr_t)elf->addr,
- elf->num, SHT_DYNSYM);
+ symtab = elf64_find_section_header_type(
+ (struct Elf64_Shdr *) (lpaddr_t) elf->addr, elf->num, SHT_DYNSYM);
if (symtab == NULL) {
panic("Kernel image does not include symbol table!");
}
+ printf("Continuing... 4\n");
+
// Alias kernel on top of memory, keep low memory
- paging_init((lpaddr_t)&_start_kernel, SIZE_KERNEL_IMAGE);
+ paging_init((lpaddr_t) &_start_kernel, SIZE_KERNEL_IMAGE);
// Relocate kernel image for top of memory
- elf64_relocate(X86_64_MEMORY_OFFSET + (lvaddr_t)&_start_kernel,
- (lvaddr_t)&_start_kernel,
- (struct Elf64_Rela *)(rela->sh_addr - X86_64_START_KERNEL_PHYS + &_start_kernel),
- rela->sh_size,
- (struct Elf64_Sym *)(symtab->sh_addr - X86_64_START_KERNEL_PHYS + &_start_kernel),
- symtab->sh_size,
- X86_64_START_KERNEL_PHYS, &_start_kernel);
+ elf64_relocate(
+ X86_64_MEMORY_OFFSET + (lvaddr_t) &_start_kernel,
+ (lvaddr_t) &_start_kernel,
+ (struct Elf64_Rela *) (rela->sh_addr - X86_64_START_KERNEL_PHYS
+ + &_start_kernel),
+ rela->sh_size,
+ (struct Elf64_Sym *) (symtab->sh_addr - X86_64_START_KERNEL_PHYS
+ + &_start_kernel),
+ symtab->sh_size,
+ X86_64_START_KERNEL_PHYS,
+ &_start_kernel);
/*** Aliased kernel available now -- low memory still mapped ***/
// Relocate stack to aliased location
relocate_stack(X86_64_MEMORY_OFFSET);
+ printf("Before reloc_text_init()\n");
+
+ while(1)
+ ;
+
// Call aliased text_init() function and continue initialization
reloc_text_init();
}
OUTPUT_FORMAT("elf64-x86-64")
OUTPUT_ARCH("i386:x86-64")
+/* OUTPUT_ARCH(k1om)*/
_start_kernel = X86_64_START_KERNEL_PHYS;
-SECTIONS {
- . = ALIGN(4k);
- .text X86_64_START_KERNEL_PHYS : ALIGN(4k)
- {
- *(.text);
- }
- _end_kernel_text = .;
-
- . = ALIGN(4k);
- .rodata . :
- {
- *(.rodata);
- }
-
- .bss . :
- {
- *(.bss);
- }
-
- _end_kernel = .;
- /***** These sections get discarded *****/
+ENTRY(startup_64)
+SECTIONS
+{
+ /* Be careful parts of head_64.S assume startup_32 is at
+ * address 0.
+ */
+ . = 0 ;
+ .head.text : {
+ _head = . ;
+ *(.head.text)
+ _ehead = . ;
+ }
+ .rodata..compressed : {
+ *(.rodata..compressed)
+ }
+ .text : {
+ _text = .; /* Text */
+ *(.text)
+ *(.text.*)
+ _etext = . ;
+ }
+ .rodata : {
+ _rodata = . ;
+ *(.rodata) /* read-only data */
+ *(.rodata.*)
+ _erodata = . ;
+ }
+ .got : {
+ _got = .;
+ KEEP(*(.got.plt))
+ KEEP(*(.got))
+ _egot = .;
+ }
+ .data : {
+ _data = . ;
+ *(.data)
+ *(.data.*)
+ _edata = . ;
+ }
+ . = ALIGN((1 << (6)));
+ .bss : {
+ _bss = . ;
+ *(.bss)
+ *(.bss.*)
+ *(COMMON)
+ . = ALIGN(8); /* For convenience during zeroing */
+ _ebss = .;
+ }
+ . = ALIGN((1 << 12));
+ .pgtable : {
+ _pgtable = . ;
+ *(.pgtable)
+ _epgtable = . ;
+ }
+ _end_kernel = .;
+
+ /***** These sections get discarded *****/
/DISCARD/ :
{
/* Discard exception handler frames and headers -- we don't use em */
*(.eh_frame);
*(.eh_frame_hdr);
- *(.note.gnu.build-id);
+ *(.note.gnu.build-id);
*(.interp);
/* *(.dynsym); */
/* *(.dynstr); */
/* *(.gnu.hash); */
*(.dynamic);
}
-}
+}
\ No newline at end of file
--- /dev/null
+/**
+ * \file
+ * \brief A basic (virtual) serial output for the Xeon Phi
+ *
+ */
+
+/*
+ * Copyright (c) 2014 ETH Zurich.
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached LICENSE file.
+ * If you do not find this file, copies can be found by writing to:
+ * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
+ */
+
+#include <kernel.h>
+#include <x86.h>
+#include <serial.h>
+
+#define SBOX_BASE 0x08007D0000ULL
+#define SBOX_SCRATCH14 0x0000AB58
+#define SBOX_SCRATCH15 0x0000AB5C
+#define SBOX_SCRATCH8 0x0000AB40
+
+//static uint8_t *sbox_base = (uint8_t *)SBOX_BASE;
+
+/* todo: get rid of those */
+unsigned serial_console_port;
+unsigned serial_debug_port;
+int serial_portbase;
+
+union xeon_phi_message {
+ uint32_t val;
+ char c[4];
+};
+
+/** \brief Initialise the serial driver. */
+errval_t serial_init(unsigned port) {
+
+ // XXX: if non-BSP core, assume HW is already initialised
+ if (!arch_core_is_bsp()) {
+ return SYS_ERR_OK;
+ }
+
+ return SYS_ERR_OK;
+}
+
+errval_t serial_early_init(unsigned port) {
+
+ /* clear out the control register */
+ uint32_t *signal = (uint32_t*) ((void *) SBOX_BASE + SBOX_SCRATCH8);
+ *signal = 0;
+ return SYS_ERR_OK;
+}
+
+union xeon_phi_message data_buf;
+union xeon_phi_message data_ctrl;
+uint32_t didx = 0;
+
+
+/** \brief Prints a single character to the default serial port. */
+void serial_putchar(unsigned port, char c) {
+ volatile uint32_t *ctrl = ((uint32_t *) (SBOX_BASE + SBOX_SCRATCH8));
+ volatile uint32_t *data = ((uint32_t *) (SBOX_BASE + SBOX_SCRATCH15));
+
+ data_buf.c[didx] = c;
+ data_ctrl.c[didx] = 0x7A;
+ ++didx;
+
+ if (c == '\n' || didx == 4) {
+ // write
+ while ((*ctrl))
+ ;
+
+ *data = data_buf.val;
+ (*ctrl) = data_ctrl.val;
+ data_buf.val = 0;
+ data_ctrl.val = 0;
+ didx = 0;
+ }
+}
+
+/** \brief Reads a single character from the default serial port.
+ * This function spins waiting for a character to arrive.
+ */
+char serial_getchar(unsigned port) {
+ assert(!"Not possible to get input from Host");
+ return '\0';
+}
* ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
*/
-#include <arch/x86/kputchar.h>
+
+#include <arch/x86/conio.h>
+#include <serial.h>
+#include <arch/x86/global.h>
+
+#define kprintf_begin() acquire_spinlock(&global->locks.print)
+#define kprintf_end() release_spinlock(&global->locks.print)
+
+
+#if 0
+static void delay(uint64_t ticks)
+{
+ uint64_t start = rdtsc();
+ while (rdtsc() < start + ticks) {}
+}
+#endif
+
+/* send all output to both VGA console and serial port, for now */
+static inline int
+kputchar(int c)
+{
+#ifndef __scc__
+ if (c == '\n') {
+ serial_console_putchar('\r');
+ //delay(200000000);
+ }
+
+ conio_putchar(c);
+#endif
+ serial_console_putchar(c);
+ return c;
+}
--- /dev/null
+/**
+ * \file
+ * \brief contains functions to signal a linux based host
+ */
+
+/*
+ * Copyright (c) 2007, 2008, ETH Zurich.
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached LICENSE file.
+ * If you do not find this file, copies can be found by writing to:
+ * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
+ */
+
+
+static inline void notify_host(void) {
+ volatile uint32_t *signal;
+ /* XXX this has to be done without MMU enabled or with 1:1 mapping */
+ signal = (uint32_t *)(0x08007D0000ULL + 0x0000AB28);
+ *signal |= 0x1;
+}
#ifndef OFFSETS_ARCH_H
#define OFFSETS_ARCH_H
-#include <target/x86_64/offsets_target.h>
+#include <target/k1om/offsets_target.h>
#define PADDR_SPACE_SIZE X86_64_PADDR_SPACE_SIZE
#define PADDR_SPACE_LIMIT X86_64_PADDR_SPACE_LIMIT
* Start address of kernel image in physical memory. This is passed to
* the linker also. The bootloader will load us there.
*/
-#define X86_64_START_KERNEL_PHYS 0x100000
+#define X86_64_START_KERNEL_PHYS 0x10000
+//#define X86_64_START_KERNEL_PHYS 0x0
/**
* Kernel stack size -- 16KB
char *tailp; /* tail pointer for snprintf */
tailp = NULL; /* XXX: shutup gcc */
+
+/*
+ * XXX: somehow this does not work on k1om
+ */
+#ifndef __k1om__
if (oflags == TOBUFONLY)
tailp = &sbuf[bufsize];
-
+#endif
n = 0; /* XXX: shutup gcc */
cp = NULL; /* XXX: shutup gcc */
size = 0; /* XXX: shutup gcc */
+++ /dev/null
-diff --git a/bfd/config.bfd b/bfd/config.bfd
-index 5324d39a21cb..3f0119ab2649 100644
---- a/bfd/config.bfd
-+++ b/bfd/config.bfd
-@@ -583,6 +583,10 @@
- targ_selvecs="i386linux_vec i386pei_vec"
- targ64_selvecs="bfd_elf64_x86_64_vec bfd_elf32_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
- ;;
-+ i[3-7]86-*-barrelfish*)
-+ targ_defvec=bfd_elf32_i386_vec
-+ targ_selvecs=bfd_elf32_i386_vec
-+ ;;
- i[3-7]86-*-nacl*)
- targ_defvec=bfd_elf32_i386_nacl_vec
- targ_selvecs="bfd_elf32_i386_vec"
-@@ -660,6 +664,15 @@
- targ_selvecs="bfd_elf64_x86_64_vec bfd_elf32_i386_vec bfd_elf32_x86_64_vec i386linux_vec i386pei_vec x86_64pei_vec bfd_elf64_l1om_vec"
- want64=true
- ;;
-+ x86_64-*-barrelfish*)
-+ targ_defvec=bfd_elf64_x86_64_vec
-+ targ_selvecs=bfd_elf64_x86_64_vec
-+ want64=true
-+ ;;
-+ k1om-*-barrelfish*)
-+ targ_defvec=bfd_elf64_k1om_vec
-+ targ_selvecs="bfd_elf64_x86_64_vec bfd_elf64_k1om_vec bfd_elf64_l1om_vec"
-#+ targ_selvecs="bfd_elf64_k1om_vec bfd_elf64_l1om_vec"
-+ want64=true ;;
- k1om-*-mingw* | k1om-*-pe | k1om-*-pep)
- targ_defvec=bfd_elf64_k1om_vec
- targ_selvecs="x86_64pe_vec x86_64pei_vec bfd_elf64_x86_64_vec bfd_elf64_l1om_vec i386pe_vec i386pei_vec bfd_elf32_i386_vec"
-diff --git a/config.sub b/config.sub
-index 61cb4bc22db8..bc3ec8c48906 100755
---- a/config.sub
-+++ b/config.sub
-@@ -1335,7 +1335,7 @@
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-- | -aos* | -aros* \
-+ | -aos* | -aros* | -barrelfish*\
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-diff --git a/configure b/configure
-index ee45e1b00f90..5bb841e5899d 100755
---- a/configure
-+++ b/configure
-@@ -2867,7 +2867,7 @@
- is_elf=no
- case "${target}" in
- *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
-- | *-*-linux* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
-+ | *-*-linux* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* | *-*-barrelfish \
- | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
- | *-*-solaris2* | *-*-nto*)
- case "${target}" in
-
-diff --git a/gas/configure.tgt b/gas/configure.tgt
-index 77c1d9b59246..5b32ae8f8a0c 100644
---- a/gas/configure.tgt
-+++ b/gas/configure.tgt
-@@ -197,6 +197,7 @@
- i386-*-openbsd[0-2].* | \
- i386-*-openbsd3.[0-2]) fmt=aout em=nbsd ;;
- i386-*-openbsd*) fmt=elf em=nbsd ;;
-+ i386-*-barrelfish*) fmt=elf ;;
- i386-*-linux*aout*) fmt=aout em=linux ;;
- i386-*-linux*oldld) fmt=aout em=linux ;;
- i386-*-linux*coff*) fmt=coff em=linux ;;
-diff --git a/ld/Makefile.am b/ld/Makefile.am
-index b2b2a6ebe362..c01570b158ba 100644
---- a/ld/Makefile.am
-+++ b/ld/Makefile.am
-@@ -259,6 +259,7 @@
- eelf32xstormy16.c \
- eelf32xtensa.c \
- eelf_i386.c \
-+ ebarrelfish_i386.c
- eelf_i386_be.c \
- eelf_i386_chaos.c \
- eelf_i386_fbsd.c \
-@@ -484,6 +485,7 @@
- eelf64ppc_fbsd.c \
- eelf64tilegx.c \
- eelf64tilegx_be.c \
-+ ebarrelfish_k1om.c \
- eelf_l1om.c \
- eelf_l1om_fbsd.c \
- eelf_k1om.c \
-@@ -1189,6 +1191,15 @@
- eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_i386 "$(tdir_elf_i386)"
-+ebarrelfish_i386.c: $(srcdir)/emulparams/barrelfish_i386.sh \
-+ $(ELF_DEPS) $(srcdir)/scripttempl/elf-barrelfish.sc ${GEN_DEPENDS}
-+ ${GENSCRIPTS} barrelfish_i386 "$(tdir_barrelfish_i386)"
-+ebarrelfish_x86_64.c: $(srcdir)/emulparams/barrelfish_x86_64.sh \
-+ $(ELF_DEPS) $(srcdir)/scripttempl/elf-barrelfish.sc ${GEN_DEPENDS}
-+ ${GENSCRIPTS} barrelfish_x86_64 "$(tdir_barrelfish_x86_64)"
-+ebarrelfish_k1om.c: $(srcdir)/emulparams/barrelfish_k1om.sh \
-+ $(ELF_DEPS) $(srcdir)/scripttempl/elf-barrelfish.sc ${GEN_DEPENDS}
-+ ${GENSCRIPTS} barrelfish_k1om "$(tdir_barrelfish_k1om)"
- eelf_i386_be.c: $(srcdir)/emulparams/elf_i386_be.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_i386_be "$(tdir_elf_i386_be)"
-diff --git a/ld/Makefile.in b/ld/Makefile.in
-index b95a3d103de4..d41557b3334c 100644
---- a/ld/Makefile.in
-+++ b/ld/Makefile.in
-@@ -565,6 +565,7 @@
- eelf32xstormy16.c \
- eelf32xtensa.c \
- eelf_i386.c \
-+ ebarrelfish_i386.c \
- eelf_i386_be.c \
- eelf_i386_chaos.c \
- eelf_i386_fbsd.c \
-@@ -793,6 +794,8 @@
- eelf_l1om_fbsd.c \
- eelf_k1om.c \
- eelf_k1om_fbsd.c \
-+ ebarrelfish_k1om.c \
-+ ebarrelfish_x86_64.c \
- eelf_x86_64.c \
- eelf_x86_64_fbsd.c \
- eelf_x86_64_sol2.c \
-@@ -3473,6 +3476,15 @@
- $(srcdir)/emulparams/elf_k1om.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_k1om_fbsd "$(tdir_elf_k1om_fbsd)"
-+ebarrelfish_i386.c: $(srcdir)/emulparams/barrelfish_i386.sh \
-+ $(ELF_DEPS) $(srcdir)/scripttempl/elf-barrelfish.sc ${GEN_DEPENDS}
-+ ${GENSCRIPTS} barrelfish_i386 "$(tdir_barrelfish_i386)"
-+ebarrelfish_x86_64.c: $(srcdir)/emulparams/barrelfish_x86_64.sh \
-+ $(ELF_DEPS) $(srcdir)/scripttempl/elf-barrelfish.sc ${GEN_DEPENDS}
-+ ${GENSCRIPTS} barrelfish_x86_64 "$(tdir_barrelfish_x86_64)"
-+ebarrelfish_k1om.c: $(srcdir)/emulparams/barrelfish_k1om.sh \
-+ $(ELF_DEPS) $(srcdir)/scripttempl/elf-barrelfish.sc ${GEN_DEPENDS}
-+ ${GENSCRIPTS} barrelfish_k1om "$(tdir_barrelfish_k1om)"
- eelf_x86_64.c: $(srcdir)/emulparams/elf_x86_64.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_x86_64 "$(tdir_elf_x86_64)"
-diff --git a/ld/configure.tgt b/ld/configure.tgt
-index c50730b9c514..27702cbedc3a 100644
---- a/ld/configure.tgt
-+++ b/ld/configure.tgt
-@@ -186,6 +186,7 @@
- targ_extra_emuls=elf_i386
- tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'` ;;
- i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
-+i[3-7]86-*-barrelfish*) targ_emul=barrelfish_i386 ;;
- i[3-7]86-*-linux-*) targ_emul=elf_i386
- targ_extra_emuls=i386linux
- targ64_extra_emuls="elf_x86_64 elf32_x86_64 elf_l1om elf_k1om"
-@@ -212,6 +213,10 @@
- targ_extra_libpath="elf_i386 elf32_x86_64 elf_x86_64"
- tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
- tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'` ;;
-+k1om-*-barrelfish*) targ_emul=elf_k1om
-+ targ_extra_emuls="barrelfish_k1om barrelfish_x86_64 elf_x86_64"
-#+ targ_extra_emuls="barrelfish_k1om"
-+ targ_extra_libpath="barrelfish_k1om elf_k1om barrelfish_x86_64 elf_x86_64" ;;
-#+ targ_extra_libpath="elf_k1om" ;;
-+x86_64-*-barrelfish*) targ_emul=barrelfish_x86_64 ;;
- x86_64-*-linux-*) targ_emul=elf_x86_64
- targ_extra_emuls="elf32_x86_64 elf_i386 i386linux elf_l1om elf_k1om"
- targ_extra_libpath="elf_i386 elf32_x86_64 elf_l1om elf_k1om"
-diff --git a/ld/emulparams/barrelfish_i386.sh b/ld/emulparams/barrelfish_i386.sh
-new file mode 100644
-index 000000000000..032dd5ae18a3
---- /dev/null
-+++ b/ld/emulparams/barrelfish_i386.sh
-@@ -0,0 +1,14 @@
-+. ${srcdir}/emulparams/plt_unwind.sh
-+SCRIPT_NAME=elf-barrelfish
-+OUTPUT_FORMAT="elf32-i386"
-+NO_RELA_RELOCS=yes
-+TEXT_START_ADDR=0x400000
-+MAXPAGESIZE=0x1000
-+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
-+ARCH=i386
-+MACHINE=
-+TEMPLATE_NAME=elf32
-+GENERATE_SHLIB_SCRIPT=no
-+GENERATE_PIE_SCRIPT=yes
-+NO_SMALL_DATA=yes
-+SEPARATE_GOTPLT="SIZEOF (.got.plt) >= 12 ? 12 : 0"
-diff --git a/ld/emulparams/barrelfish_x86_64.sh b/ld/emulparams/barrelfish_x86_64.sh
-new file mode 100644
-index 000000000000..bf4dafdd6b2b
---- /dev/null
-+++ b/ld/emulparams/barrelfish_x86_64.sh
-@@ -0,0 +1,16 @@
-+. ${srcdir}/emulparams/plt_unwind.sh
-+SCRIPT_NAME=elf-barrelfish
-+ELFSIZE=64
-+OUTPUT_FORMAT="elf64-x86-64"
-+NO_RELA_RELOCS=yes
-+TEXT_START_ADDR=0x400000
-+MAXPAGESIZE=0x1000
-+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
-+ARCH="i386:x86-64"
-+MACHINE=
-+TEMPLATE_NAME=elf32
-+GENERATE_SHLIB_SCRIPT=no
-+GENERATE_PIE_SCRIPT=yes
-+NO_SMALL_DATA=yes
-+LARGE_SECTIONS=yes
-+SEPARATE_GOTPLT="SIZEOF (.got.plt) >= 24 ? 24 : 0"
-diff --git a/ld/emulparams/barrelfish_k1om.sh b/ld/emulparams/barrelfish_k1om.sh
-new file mode 100644
-index 000000000000..bf4dafdd6b2b
---- /dev/null
-+++ b/ld/emulparams/barrelfish_k1om.sh
-@@ -0,0 +1,18 @@
-+. ${srcdir}/emulparams/plt_unwind.sh
-+SCRIPT_NAME=elf-barrelfish
-+ELFSIZE=64
-+OUTPUT_FORMAT="elf64-k1om"
-+NO_RELA_RELOCS=yes
-+TEXT_START_ADDR=0x400000
-+MAXPAGESIZE=0x1000
-+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
-+ARCH="k1om"
-+MACHINE=
-+COMPILE_IN=yes
-+TEMPLATE_NAME=elf32
-+GENERATE_SHLIB_SCRIPT=yes
-+GENERATE_PIE_SCRIPT=yes
-+NO_SMALL_DATA=yes
-+LARGE_SECTIONS=yes
-+SEPARATE_GOTPLT=24 #"SIZEOF (.got.plt) >= 24 ? 24 : 0"
-+LIBPATH_SUFFIX=64 ;;
-diff --git a/ld/scripttempl/elf-barrelfish.sc b/ld/scripttempl/elf-barrelfish.sc
-new file mode 100644
-index 000000000000..51a655eed65c
---- /dev/null
-+++ b/ld/scripttempl/elf-barrelfish.sc
-@@ -0,0 +1,664 @@
-+#
-+# Unusual variables checked by this code:
-+# NOP - four byte opcode for no-op (defaults to none)
-+# NO_SMALL_DATA - no .sbss/.sbss2/.sdata/.sdata2 sections if not
-+# empty.
-+# SMALL_DATA_CTOR - .ctors contains small data.
-+# SMALL_DATA_DTOR - .dtors contains small data.
-+# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
-+# INITIAL_READONLY_SECTIONS - at start of text segment
-+# OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
-+# (e.g., .PARISC.milli)
-+# OTHER_TEXT_SECTIONS - these get put in .text when relocating
-+# OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
-+# (e.g., .PARISC.global)
-+# OTHER_RELRO_SECTIONS - other than .data.rel.ro ...
-+# (e.g. PPC32 .fixup, .got[12])
-+# OTHER_BSS_SECTIONS - other than .bss .sbss ...
-+# ATTRS_SECTIONS - at the end
-+# OTHER_SECTIONS - at the end
-+# EXECUTABLE_SYMBOLS - symbols that must be defined for an
-+# executable (e.g., _DYNAMIC_LINK)
-+# TEXT_START_ADDR - the first byte of the text segment, after any
-+# headers.
-+# TEXT_BASE_ADDRESS - the first byte of the text segment.
-+# TEXT_START_SYMBOLS - symbols that appear at the start of the
-+# .text section.
-+# DATA_START_SYMBOLS - symbols that appear at the start of the
-+# .data section.
-+# DATA_END_SYMBOLS - symbols that appear at the end of the
-+# writeable data sections.
-+# OTHER_GOT_SYMBOLS - symbols defined just before .got.
-+# OTHER_GOT_SECTIONS - sections just after .got.
-+# OTHER_SDATA_SECTIONS - sections just after .sdata.
-+# OTHER_BSS_SYMBOLS - symbols that appear at the start of the
-+# .bss section besides __bss_start.
-+# DATA_PLT - .plt should be in data segment, not text segment.
-+# PLT_BEFORE_GOT - .plt just before .got when .plt is in data segement.
-+# BSS_PLT - .plt should be in bss segment
-+# NO_REL_RELOCS - Don't include .rel.* sections in script
-+# NO_RELA_RELOCS - Don't include .rela.* sections in script
-+# NON_ALLOC_DYN - Place dynamic sections after data segment.
-+# TEXT_DYNAMIC - .dynamic in text segment, not data segment.
-+# EMBEDDED - whether this is for an embedded system.
-+# SHLIB_TEXT_START_ADDR - if set, add to SIZEOF_HEADERS to set
-+# start address of shared library.
-+# INPUT_FILES - INPUT command of files to always include
-+# WRITABLE_RODATA - if set, the .rodata section should be writable
-+# INIT_START, INIT_END - statements just before and just after
-+# combination of .init sections.
-+# FINI_START, FINI_END - statements just before and just after
-+# combination of .fini sections.
-+# STACK_ADDR - start of a .stack section.
-+# OTHER_SYMBOLS - symbols to place right at the end of the script.
-+# ETEXT_NAME - name of a symbol for the end of the text section,
-+# normally etext.
-+# SEPARATE_CODE - if set, .text and similar sections containing
-+# actual machine instructions must be in wholly disjoint
-+# pages from any other data, including headers
-+# SEPARATE_GOTPLT - if set, .got.plt should be separate output section,
-+# so that .got can be in the RELRO area. It should be set to
-+# the number of bytes in the beginning of .got.plt which can be
-+# in the RELRO area as well.
-+# USER_LABEL_PREFIX - prefix to add to user-visible symbols.
-+# RODATA_NAME, SDATA_NAME, SBSS_NAME, BSS_NAME - base parts of names
-+# for standard sections, without initial "." or suffixes.
-+#
-+# When adding sections, do note that the names of some sections are used
-+# when specifying the start address of the next.
-+#
-+
-+# Many sections come in three flavours. There is the 'real' section,
-+# like ".data". Then there are the per-procedure or per-variable
-+# sections, generated by -ffunction-sections and -fdata-sections in GCC,
-+# and useful for --gc-sections, which for a variable "foo" might be
-+# ".data.foo". Then there are the linkonce sections, for which the linker
-+# eliminates duplicates, which are named like ".gnu.linkonce.d.foo".
-+# The exact correspondences are:
-+#
-+# Section Linkonce section
-+# .text .gnu.linkonce.t.foo
-+# .rodata .gnu.linkonce.r.foo
-+# .data .gnu.linkonce.d.foo
-+# .bss .gnu.linkonce.b.foo
-+# .sdata .gnu.linkonce.s.foo
-+# .sbss .gnu.linkonce.sb.foo
-+# .sdata2 .gnu.linkonce.s2.foo
-+# .sbss2 .gnu.linkonce.sb2.foo
-+# .debug_info .gnu.linkonce.wi.foo
-+# .tdata .gnu.linkonce.td.foo
-+# .tbss .gnu.linkonce.tb.foo
-+# .lrodata .gnu.linkonce.lr.foo
-+# .ldata .gnu.linkonce.l.foo
-+# .lbss .gnu.linkonce.lb.foo
-+#
-+# Each of these can also have corresponding .rel.* and .rela.* sections.
-+
-+if test -n "$NOP"; then
-+ FILL="=$NOP"
-+else
-+ FILL=
-+fi
-+
-+test -z "$RODATA_NAME" && RODATA_NAME=rodata
-+test -z "$SDATA_NAME" && SDATA_NAME=sdata
-+test -z "$SBSS_NAME" && SBSS_NAME=sbss
-+test -z "$BSS_NAME" && BSS_NAME=bss
-+test -z "$ENTRY" && ENTRY=${USER_LABEL_PREFIX}_start
-+test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
-+test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
-+if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
-+test -z "${ELFSIZE}" && ELFSIZE=32
-+test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8"
-+test "$LD_FLAG" = "N" && DATA_ADDR=.
-+test -z "${ETEXT_NAME}" && ETEXT_NAME=${USER_LABEL_PREFIX}etext
-+test -n "$CREATE_SHLIB$CREATE_PIE" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE=""
-+test -z "$CREATE_SHLIB$CREATE_PIE" && test -n "$DATA_ADDR" && COMMONPAGESIZE=""
-+test -n "$RELRO_NOW" && unset SEPARATE_GOTPLT
-+test -z "$ATTRS_SECTIONS" && ATTRS_SECTIONS=".gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }"
-+DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))"
-+DATA_SEGMENT_RELRO_END=""
-+DATA_SEGMENT_END=""
-+if test -n "${COMMONPAGESIZE}"; then
-+ DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})"
-+ DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);"
-+ DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
-+fi
-+if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
-+ INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }"
-+fi
-+if test -z "$PLT"; then
-+ IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }"
-+ PLT=".plt ${RELOCATING-0} : { *(.plt)${IREL_IN_PLT+ *(.iplt)} }
-+ ${IREL_IN_PLT-$IPLT}"
-+fi
-+test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes
-+if test -z "$GOT"; then
-+ if test -z "$SEPARATE_GOTPLT"; then
-+ GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }"
-+ else
-+ GOT=".got ${RELOCATING-0} : { *(.got) *(.igot) }"
-+ GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) }"
-+ fi
-+fi
-+REL_IFUNC=".rel.ifunc ${RELOCATING-0} : { *(.rel.ifunc) }"
-+RELA_IFUNC=".rela.ifunc ${RELOCATING-0} : { *(.rela.ifunc) }"
-+REL_IPLT=".rel.iplt ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_start = .);}}
-+ *(.rel.iplt)
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_end = .);}}
-+ }"
-+RELA_IPLT=".rela.iplt ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_start = .);}}
-+ *(.rela.iplt)
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_end = .);}}
-+ }"
-+DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }"
-+RODATA=".${RODATA_NAME} ${RELOCATING-0} : { *(.${RODATA_NAME}${RELOCATING+ .${RODATA_NAME}.* .gnu.linkonce.r.*}) }"
-+DATARELRO=".data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }"
-+DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }"
-+if test -z "${NO_SMALL_DATA}"; then
-+ SBSS=".${SBSS_NAME} ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${SBSS_START_SYMBOLS}}
-+ ${CREATE_SHLIB+*(.${SBSS_NAME}2 .${SBSS_NAME}2.* .gnu.linkonce.sb2.*)}
-+ *(.dyn${SBSS_NAME})
-+ *(.${SBSS_NAME}${RELOCATING+ .${SBSS_NAME}.* .gnu.linkonce.sb.*})
-+ *(.scommon)
-+ ${RELOCATING+${SBSS_END_SYMBOLS}}
-+ }"
-+ SBSS2=".${SBSS_NAME}2 ${RELOCATING-0} : { *(.${SBSS_NAME}2${RELOCATING+ .${SBSS_NAME}2.* .gnu.linkonce.sb2.*}) }"
-+ SDATA="/* We want the small data sections together, so single-instruction offsets
-+ can access them all, and initialized data all before uninitialized, so
-+ we can shorten the on-disk segment size. */
-+ .${SDATA_NAME} ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${SDATA_START_SYMBOLS}}
-+ ${CREATE_SHLIB+*(.${SDATA_NAME}2 .${SDATA_NAME}2.* .gnu.linkonce.s2.*)}
-+ *(.${SDATA_NAME}${RELOCATING+ .${SDATA_NAME}.* .gnu.linkonce.s.*})
-+ }"
-+ SDATA2=".${SDATA_NAME}2 ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${SDATA2_START_SYMBOLS}}
-+ *(.${SDATA_NAME}2${RELOCATING+ .${SDATA_NAME}2.* .gnu.linkonce.s2.*})
-+ }"
-+ REL_SDATA=".rel.${SDATA_NAME} ${RELOCATING-0} : { *(.rel.${SDATA_NAME}${RELOCATING+ .rel.${SDATA_NAME}.* .rel.gnu.linkonce.s.*}) }
-+ .rela.${SDATA_NAME} ${RELOCATING-0} : { *(.rela.${SDATA_NAME}${RELOCATING+ .rela.${SDATA_NAME}.* .rela.gnu.linkonce.s.*}) }"
-+ REL_SBSS=".rel.${SBSS_NAME} ${RELOCATING-0} : { *(.rel.${SBSS_NAME}${RELOCATING+ .rel.${SBSS_NAME}.* .rel.gnu.linkonce.sb.*}) }
-+ .rela.${SBSS_NAME} ${RELOCATING-0} : { *(.rela.${SBSS_NAME}${RELOCATING+ .rela.${SBSS_NAME}.* .rela.gnu.linkonce.sb.*}) }"
-+ REL_SDATA2=".rel.${SDATA_NAME}2 ${RELOCATING-0} : { *(.rel.${SDATA_NAME}2${RELOCATING+ .rel.${SDATA_NAME}2.* .rel.gnu.linkonce.s2.*}) }
-+ .rela.${SDATA_NAME}2 ${RELOCATING-0} : { *(.rela.${SDATA_NAME}2${RELOCATING+ .rela.${SDATA_NAME}2.* .rela.gnu.linkonce.s2.*}) }"
-+ REL_SBSS2=".rel.${SBSS_NAME}2 ${RELOCATING-0} : { *(.rel.${SBSS_NAME}2${RELOCATING+ .rel.${SBSS_NAME}2.* .rel.gnu.linkonce.sb2.*}) }
-+ .rela.${SBSS_NAME}2 ${RELOCATING-0} : { *(.rela.${SBSS_NAME}2${RELOCATING+ .rela.${SBSS_NAME}2.* .rela.gnu.linkonce.sb2.*}) }"
-+else
-+ NO_SMALL_DATA=" "
-+fi
-+if test -z "${DATA_GOT}"; then
-+ if test -n "${NO_SMALL_DATA}"; then
-+ DATA_GOT=" "
-+ fi
-+fi
-+if test -z "${SDATA_GOT}"; then
-+ if test -z "${NO_SMALL_DATA}"; then
-+ SDATA_GOT=" "
-+ fi
-+fi
-+test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" "
-+test "${LARGE_SECTIONS}" = "yes" && REL_LARGE="
-+ .rel.ldata ${RELOCATING-0} : { *(.rel.ldata${RELOCATING+ .rel.ldata.* .rel.gnu.linkonce.l.*}) }
-+ .rela.ldata ${RELOCATING-0} : { *(.rela.ldata${RELOCATING+ .rela.ldata.* .rela.gnu.linkonce.l.*}) }
-+ .rel.lbss ${RELOCATING-0} : { *(.rel.lbss${RELOCATING+ .rel.lbss.* .rel.gnu.linkonce.lb.*}) }
-+ .rela.lbss ${RELOCATING-0} : { *(.rela.lbss${RELOCATING+ .rela.lbss.* .rela.gnu.linkonce.lb.*}) }
-+ .rel.lrodata ${RELOCATING-0} : { *(.rel.lrodata${RELOCATING+ .rel.lrodata.* .rel.gnu.linkonce.lr.*}) }
-+ .rela.lrodata ${RELOCATING-0} : { *(.rela.lrodata${RELOCATING+ .rela.lrodata.* .rela.gnu.linkonce.lr.*}) }"
-+test "${LARGE_SECTIONS}" = "yes" && OTHER_BSS_SECTIONS="
-+ ${OTHER_BSS_SECTIONS}
-+ .lbss ${RELOCATING-0} :
-+ {
-+ *(.dynlbss)
-+ *(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*})
-+ *(LARGE_COMMON)
-+ }"
-+test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
-+ .lrodata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
-+ {
-+ *(.lrodata${RELOCATING+ .lrodata.* .gnu.linkonce.lr.*})
-+ }
-+ .ldata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
-+ {
-+ *(.ldata${RELOCATING+ .ldata.* .gnu.linkonce.l.*})
-+ ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
-+ }"
-+if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then
-+ SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))"
-+ SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))"
-+ CTORS_IN_INIT_ARRAY="KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors))"
-+ DTORS_IN_FINI_ARRAY="KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors))"
-+else
-+ SORT_INIT_ARRAY="KEEP (*(SORT(.init_array.*)))"
-+ SORT_FINI_ARRAY="KEEP (*(SORT(.fini_array.*)))"
-+ CTORS_IN_INIT_ARRAY=
-+ DTORS_IN_FINI_ARRAY=
-+fi
-+INIT_ARRAY=".init_array ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_start = .);}}
-+ ${SORT_INIT_ARRAY}
-+ KEEP (*(.init_array))
-+ ${CTORS_IN_INIT_ARRAY}
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_end = .);}}
-+ }"
-+FINI_ARRAY=".fini_array ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_start = .);}}
-+ ${SORT_FINI_ARRAY}
-+ KEEP (*(.fini_array))
-+ ${DTORS_IN_FINI_ARRAY}
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_end = .);}}
-+ }"
-+CTOR=".ctors ${CONSTRUCTING-0} :
-+ {
-+ ${CONSTRUCTING+${CTOR_START}}
-+ /* gcc uses crtbegin.o to find the start of
-+ the constructors, so we make sure it is
-+ first. Because this is a wildcard, it
-+ doesn't matter if the user does not
-+ actually link against crtbegin.o; the
-+ linker won't look for a file to match a
-+ wildcard. The wildcard also means that it
-+ doesn't matter which directory crtbegin.o
-+ is in. */
-+
-+ KEEP (*crtbegin.o(.ctors))
-+ KEEP (*crtbegin?.o(.ctors))
-+
-+ /* We don't want to include the .ctor section from
-+ the crtend.o file until after the sorted ctors.
-+ The .ctor section from the crtend file contains the
-+ end of ctors marker and it must be last */
-+
-+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors))
-+ KEEP (*(SORT(.ctors.*)))
-+ KEEP (*(.ctors))
-+ ${CONSTRUCTING+${CTOR_END}}
-+ }"
-+DTOR=".dtors ${CONSTRUCTING-0} :
-+ {
-+ ${CONSTRUCTING+${DTOR_START}}
-+ KEEP (*crtbegin.o(.dtors))
-+ KEEP (*crtbegin?.o(.dtors))
-+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors))
-+ KEEP (*(SORT(.dtors.*)))
-+ KEEP (*(.dtors))
-+ ${CONSTRUCTING+${DTOR_END}}
-+ }"
-+STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} :
-+ {
-+ ${RELOCATING+${USER_LABEL_PREFIX}_stack = .;}
-+ *(.stack)
-+ }"
-+
-+TEXT_START_ADDR="SEGMENT_START(\"text-segment\", ${TEXT_START_ADDR})"
-+SHLIB_TEXT_START_ADDR="SEGMENT_START(\"text-segment\", ${SHLIB_TEXT_START_ADDR:-0})"
-+
-+if [ -z "$SEPARATE_CODE" ]; then
-+ SIZEOF_HEADERS_CODE=" + SIZEOF_HEADERS"
-+else
-+ SIZEOF_HEADERS_CODE=
-+fi
-+
-+# if this is for an embedded system, don't add SIZEOF_HEADERS.
-+if [ -z "$EMBEDDED" ]; then
-+ test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR}${SIZEOF_HEADERS_CODE}"
-+else
-+ test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR}"
-+fi
-+
-+cat <<EOF
-+OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
-+ "${LITTLE_OUTPUT_FORMAT}")
-+OUTPUT_ARCH(${OUTPUT_ARCH})
-+${RELOCATING+ENTRY(${ENTRY})}
-+
-+${RELOCATING+${LIB_SEARCH_DIRS}}
-+${RELOCATING+${EXECUTABLE_SYMBOLS}}
-+${RELOCATING+${INPUT_FILES}}
-+${RELOCATING- /* For some reason, the Solaris linker makes bad executables
-+ if gld -r is used and the intermediate file has sections starting
-+ at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
-+ bug. But for now assigning the zero vmas works. */}
-+
-+SECTIONS
-+{
-+ /* Read-only sections, merged into text segment: */
-+ ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}}
-+ ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR}${SIZEOF_HEADERS_CODE};}}
-+ ${CREATE_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR}${SIZEOF_HEADERS_CODE};}}
-+EOF
-+
-+emit_early_ro()
-+{
-+ cat <<EOF
-+ ${INITIAL_READONLY_SECTIONS}
-+ .note.gnu.build-id : { *(.note.gnu.build-id) }
-+EOF
-+}
-+
-+test -n "${SEPARATE_CODE}" || emit_early_ro
-+
-+test -n "${RELOCATING+0}" || unset NON_ALLOC_DYN
-+test -z "${NON_ALLOC_DYN}" || TEXT_DYNAMIC=
-+cat > ldscripts/dyntmp.$$ <<EOF
-+ ${TEXT_DYNAMIC+${DYNAMIC}}
-+ .hash ${RELOCATING-0} : { *(.hash) }
-+ .gnu.hash ${RELOCATING-0} : { *(.gnu.hash) }
-+ .dynsym ${RELOCATING-0} : { *(.dynsym) }
-+ .dynstr ${RELOCATING-0} : { *(.dynstr) }
-+ .gnu.version ${RELOCATING-0} : { *(.gnu.version) }
-+ .gnu.version_d ${RELOCATING-0}: { *(.gnu.version_d) }
-+ .gnu.version_r ${RELOCATING-0}: { *(.gnu.version_r) }
-+EOF
-+
-+if [ "x$COMBRELOC" = x ]; then
-+ COMBRELOCCAT="cat >> ldscripts/dyntmp.$$"
-+else
-+ COMBRELOCCAT="cat > $COMBRELOC"
-+fi
-+eval $COMBRELOCCAT <<EOF
-+ ${INITIAL_RELOC_SECTIONS}
-+ .rel.init ${RELOCATING-0} : { *(.rel.init) }
-+ .rela.init ${RELOCATING-0} : { *(.rela.init) }
-+ .rel.text ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) }
-+ .rela.text ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
-+ .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
-+ .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
-+ .rel.${RODATA_NAME} ${RELOCATING-0} : { *(.rel.${RODATA_NAME}${RELOCATING+ .rel.${RODATA_NAME}.* .rel.gnu.linkonce.r.*}) }
-+ .rela.${RODATA_NAME} ${RELOCATING-0} : { *(.rela.${RODATA_NAME}${RELOCATING+ .rela.${RODATA_NAME}.* .rela.gnu.linkonce.r.*}) }
-+ ${OTHER_READONLY_RELOC_SECTIONS}
-+ .rel.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+ .rel.data.rel.ro.* .rel.gnu.linkonce.d.rel.ro.*}) }
-+ .rela.data.rel.ro ${RELOCATING-0} : { *(.rela.data.rel.ro${RELOCATING+ .rela.data.rel.ro.* .rela.gnu.linkonce.d.rel.ro.*}) }
-+ .rel.data ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
-+ .rela.data ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
-+ ${OTHER_READWRITE_RELOC_SECTIONS}
-+ .rel.tdata ${RELOCATING-0} : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) }
-+ .rela.tdata ${RELOCATING-0} : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) }
-+ .rel.tbss ${RELOCATING-0} : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) }
-+ .rela.tbss ${RELOCATING-0} : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) }
-+ .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
-+ .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
-+ .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
-+ .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
-+ .rel.got ${RELOCATING-0} : { *(.rel.got) }
-+ .rela.got ${RELOCATING-0} : { *(.rela.got) }
-+ ${OTHER_GOT_RELOC_SECTIONS}
-+ ${REL_SDATA}
-+ ${REL_SBSS}
-+ ${REL_SDATA2}
-+ ${REL_SBSS2}
-+ .rel.${BSS_NAME} ${RELOCATING-0} : { *(.rel.${BSS_NAME}${RELOCATING+ .rel.${BSS_NAME}.* .rel.gnu.linkonce.b.*}) }
-+ .rela.${BSS_NAME} ${RELOCATING-0} : { *(.rela.${BSS_NAME}${RELOCATING+ .rela.${BSS_NAME}.* .rela.gnu.linkonce.b.*}) }
-+ ${REL_LARGE}
-+ ${IREL_IN_PLT+$REL_IFUNC}
-+ ${IREL_IN_PLT+$RELA_IFUNC}
-+ ${IREL_IN_PLT-$REL_IPLT}
-+ ${IREL_IN_PLT-$RELA_IPLT}
-+EOF
-+
-+if [ -n "$COMBRELOC" ]; then
-+cat >> ldscripts/dyntmp.$$ <<EOF
-+ .rel.dyn ${RELOCATING-0} :
-+ {
-+EOF
-+sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$
-+cat >> ldscripts/dyntmp.$$ <<EOF
-+ }
-+ .rela.dyn ${RELOCATING-0} :
-+ {
-+EOF
-+sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$
-+cat >> ldscripts/dyntmp.$$ <<EOF
-+ }
-+EOF
-+fi
-+
-+cat >> ldscripts/dyntmp.$$ <<EOF
-+ .rel.plt ${RELOCATING-0} :
-+ {
-+ *(.rel.plt)
-+ ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_start = .);}}}
-+ ${IREL_IN_PLT+${RELOCATING+*(.rel.iplt)}}
-+ ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_end = .);}}}
-+ }
-+ .rela.plt ${RELOCATING-0} :
-+ {
-+ *(.rela.plt)
-+ ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_start = .);}}}
-+ ${IREL_IN_PLT+${RELOCATING+*(.rela.iplt)}}
-+ ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_end = .);}}}
-+ }
-+ ${OTHER_PLT_RELOC_SECTIONS}
-+EOF
-+
-+emit_dyn()
-+{
-+ if test -z "${NO_REL_RELOCS}${NO_RELA_RELOCS}"; then
-+ cat ldscripts/dyntmp.$$
-+ else
-+ if test -z "${NO_REL_RELOCS}"; then
-+ sed -e '/^[ ]*\.rela\.[^}]*$/,/}/d' -e '/^[ ]*\.rela\./d' ldscripts/dyntmp.$$
-+ fi
-+ if test -z "${NO_RELA_RELOCS}"; then
-+ sed -e '/^[ ]*\.rel\.[^}]*$/,/}/d' -e '/^[ ]*\.rel\./d' ldscripts/dyntmp.$$
-+ fi
-+ fi
-+ rm -f ldscripts/dyntmp.$$
-+}
-+
-+test -n "${NON_ALLOC_DYN}${SEPARATE_CODE}" || emit_dyn
-+
-+cat <<EOF
-+ .init ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${INIT_START}}
-+ KEEP (*(SORT_NONE(.init)))
-+ ${RELOCATING+${INIT_END}}
-+ } ${FILL}
-+
-+ ${TEXT_PLT+${PLT}}
-+ ${TINY_READONLY_SECTION}
-+ .text ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${TEXT_START_SYMBOLS}}
-+ ${RELOCATING+*(.text.unlikely .text.*_unlikely)}
-+ ${RELOCATING+*(.text.exit .text.exit.*)}
-+ ${RELOCATING+*(.text.startup .text.startup.*)}
-+ ${RELOCATING+*(.text.hot .text.hot.*)}
-+ *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
-+ /* .gnu.warning sections are handled specially by elf32.em. */
-+ *(.gnu.warning)
-+ ${RELOCATING+${OTHER_TEXT_SECTIONS}}
-+ } ${FILL}
-+ .fini ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${FINI_START}}
-+ KEEP (*(SORT_NONE(.fini)))
-+ ${RELOCATING+${FINI_END}}
-+ } ${FILL}
-+ ${RELOCATING+PROVIDE (__${ETEXT_NAME} = .);}
-+ ${RELOCATING+PROVIDE (_${ETEXT_NAME} = .);}
-+ ${RELOCATING+PROVIDE (${ETEXT_NAME} = .);}
-+EOF
-+
-+if test -n "${SEPARATE_CODE}"; then
-+ cat <<EOF
-+ /* Adjust the address for the rodata segment. We want to adjust up to
-+ the same address within the page on the next page up. */
-+ ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${RODATA_ADDR-ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))};}}}
-+ ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_RODATA_ADDR-ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))};}}
-+ ${CREATE_PIE+${RELOCATING+. = ${SHLIB_RODATA_ADDR-ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))};}}
-+EOF
-+ emit_early_ro
-+ emit_dyn
-+fi
-+
-+cat <<EOF
-+ ${WRITABLE_RODATA-${RODATA}}
-+ .${RODATA_NAME}1 ${RELOCATING-0} : { *(.${RODATA_NAME}1) }
-+ ${CREATE_SHLIB-${SDATA2}}
-+ ${CREATE_SHLIB-${SBSS2}}
-+ ${OTHER_READONLY_SECTIONS}
-+ .eh_frame_hdr : { *(.eh_frame_hdr) }
-+ .eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
-+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table
-+ .gcc_except_table.*) }
-+ /* These sections are generated by the Sun/Oracle C++ compiler. */
-+ .exception_ranges ${RELOCATING-0} : ONLY_IF_RO { *(.exception_ranges
-+ .exception_ranges*) }
-+
-+ /* Adjust the address for the data segment. We want to adjust up to
-+ the same address within the page on the next page up. */
-+ ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}}
-+ ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
-+ ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
-+
-+ /* Exception handling */
-+ .eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
-+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
-+ .exception_ranges ${RELOCATING-0} : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
-+
-+ /* Thread Local Storage sections */
-+ .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
-+ .tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
-+
-+ .preinit_array ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_start = .);}}
-+ KEEP (*(.preinit_array))
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_end = .);}}
-+ }
-+ ${RELOCATING+${INIT_ARRAY}}
-+ ${RELOCATING+${FINI_ARRAY}}
-+ ${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
-+ ${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}}
-+ .jcr ${RELOCATING-0} : { KEEP (*(.jcr)) }
-+
-+ ${RELOCATING+${DATARELRO}}
-+ ${OTHER_RELRO_SECTIONS}
-+ ${TEXT_DYNAMIC-${DYNAMIC}}
-+ ${DATA_GOT+${RELRO_NOW+${GOT}}}
-+ ${DATA_GOT+${RELRO_NOW+${GOTPLT}}}
-+ ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT+${GOT}}}}
-+ ${RELOCATING+${DATA_SEGMENT_RELRO_END}}
-+ ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT-${GOT}}}}
-+ ${DATA_GOT+${RELRO_NOW-${GOTPLT}}}
-+
-+ ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}}
-+
-+ .data ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${DATA_START_SYMBOLS}}
-+ *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
-+ ${CONSTRUCTING+SORT(CONSTRUCTORS)}
-+ }
-+ .data1 ${RELOCATING-0} : { *(.data1) }
-+ ${WRITABLE_RODATA+${RODATA}}
-+ ${OTHER_READWRITE_SECTIONS}
-+ ${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}}
-+ ${SMALL_DATA_DTOR+${RELOCATING+${DTOR}}}
-+ ${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}}
-+ ${SDATA_GOT+${RELOCATING+${OTHER_GOT_SYMBOLS+. = .; ${OTHER_GOT_SYMBOLS}}}}
-+ ${SDATA_GOT+${GOT}}
-+ ${SDATA_GOT+${OTHER_GOT_SECTIONS}}
-+ ${SDATA}
-+ ${OTHER_SDATA_SECTIONS}
-+ ${RELOCATING+${DATA_END_SYMBOLS-${USER_LABEL_PREFIX}_edata = .; PROVIDE (${USER_LABEL_PREFIX}edata = .);}}
-+ ${RELOCATING+. = .;}
-+ ${RELOCATING+${USER_LABEL_PREFIX}__bss_start = .;}
-+ ${RELOCATING+${OTHER_BSS_SYMBOLS}}
-+ ${SBSS}
-+ ${BSS_PLT+${PLT}}
-+ .${BSS_NAME} ${RELOCATING-0} :
-+ {
-+ *(.dyn${BSS_NAME})
-+ *(.${BSS_NAME}${RELOCATING+ .${BSS_NAME}.* .gnu.linkonce.b.*})
-+ *(COMMON)
-+ /* Align here to ensure that the .bss section occupies space up to
-+ _end. Align after .bss to ensure correct alignment even if the
-+ .bss section disappears because there are no input sections.
-+ FIXME: Why do we need it? When there is no .bss section, we don't
-+ pad the .data section. */
-+ ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
-+ }
-+ ${OTHER_BSS_SECTIONS}
-+ ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
-+ ${RELOCATING+. = ALIGN(${ALIGNMENT});}
-+ ${LARGE_SECTIONS}
-+ ${RELOCATING+. = ALIGN(${ALIGNMENT});}
-+ ${RELOCATING+${OTHER_END_SYMBOLS}}
-+ ${RELOCATING+${END_SYMBOLS-${USER_LABEL_PREFIX}_end = .; PROVIDE (${USER_LABEL_PREFIX}end = .);}}
-+ ${RELOCATING+${DATA_SEGMENT_END}}
-+EOF
-+
-+test -z "${NON_ALLOC_DYN}" || emit_dyn
-+
-+cat <<EOF
-+ /* Stabs debugging sections. */
-+ .stab 0 : { *(.stab) }
-+ .stabstr 0 : { *(.stabstr) }
-+ .stab.excl 0 : { *(.stab.excl) }
-+ .stab.exclstr 0 : { *(.stab.exclstr) }
-+ .stab.index 0 : { *(.stab.index) }
-+ .stab.indexstr 0 : { *(.stab.indexstr) }
-+
-+ .comment 0 : { *(.comment) }
-+
-+ /* DWARF debug sections.
-+ Symbols in the DWARF debugging sections are relative to the beginning
-+ of the section so we begin them at 0. */
-+
-+ /* DWARF 1 */
-+ .debug 0 : { *(.debug) }
-+ .line 0 : { *(.line) }
-+
-+ /* GNU DWARF 1 extensions */
-+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
-+ .debug_sfnames 0 : { *(.debug_sfnames) }
-+
-+ /* DWARF 1.1 and DWARF 2 */
-+ .debug_aranges 0 : { *(.debug_aranges) }
-+ .debug_pubnames 0 : { *(.debug_pubnames) }
-+
-+ /* DWARF 2 */
-+ .debug_info 0 : { *(.debug_info${RELOCATING+ .gnu.linkonce.wi.*}) }
-+ .debug_abbrev 0 : { *(.debug_abbrev) }
-+ .debug_line 0 : { *(.debug_line) }
-+ .debug_frame 0 : { *(.debug_frame) }
-+ .debug_str 0 : { *(.debug_str) }
-+ .debug_loc 0 : { *(.debug_loc) }
-+ .debug_macinfo 0 : { *(.debug_macinfo) }
-+
-+ /* SGI/MIPS DWARF 2 extensions */
-+ .debug_weaknames 0 : { *(.debug_weaknames) }
-+ .debug_funcnames 0 : { *(.debug_funcnames) }
-+ .debug_typenames 0 : { *(.debug_typenames) }
-+ .debug_varnames 0 : { *(.debug_varnames) }
-+
-+ /* DWARF 3 */
-+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
-+ .debug_ranges 0 : { *(.debug_ranges) }
-+
-+ /* DWARF Extension. */
-+ .debug_macro 0 : { *(.debug_macro) }
-+
-+ ${TINY_DATA_SECTION}
-+ ${TINY_BSS_SECTION}
-+
-+ ${STACK_ADDR+${STACK}}
-+ ${ATTRS_SECTIONS}
-+ ${OTHER_SECTIONS}
-+ ${RELOCATING+${OTHER_SYMBOLS}}
-+ ${RELOCATING+${DISCARDED}}
-+}
-+EOF
+++ /dev/null
-diff --git a/bfd/config.bfd b/bfd/config.bfd
-index 5324d39a21cb..3f0119ab2649 100644
---- a/bfd/config.bfd
-+++ b/bfd/config.bfd
-@@ -630,6 +630,10 @@ case "${targ}" in
- targ64_selvecs="bfd_elf64_x86_64_nacl_vec bfd_elf32_x86_64_nacl_vec"
- targ_archs="$targ_archs bfd_arm_arch"
- ;;
-+ i[3-7]86-*-barrelfish*)
-+ targ_defvec=bfd_elf32_i386_vec
-+ targ_selvecs=bfd_elf32_i386_vec
-+ ;;
- #ifdef BFD64
- x86_64-*-darwin*)
- targ_defvec=mach_o_x86_64_vec
-@@ -673,6 +681,16 @@ case "${targ}" in
- targ_archs="$targ_archs bfd_arm_arch"
- want64=true
- ;;
-+ x86_64-k1om-barrelfish*)
-+ targ_defvec=bfd_elf64_k1om_vec
-+ targ_selvecs="bfd_elf32_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec bfd_elf64_x86_64_vec"
-+ want64=true
-+ ;;
-+ x86_64-*-barrelfish*)
-+ targ_defvec=bfd_elf64_x86_64_vec
-+ targ_selvecs=bfd_elf64_x86_64_vec
-+ want64=true
-+ ;;
- x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin)
- targ_defvec=x86_64pe_vec
- targ_selvecs="x86_64pe_vec x86_64pei_vec bfd_elf64_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec i386pe_vec i386pei_vec bfd_elf32_i386_vec"
-diff --git a/config.sub b/config.sub
-index 61cb4bc22db8..bc3ec8c48906 100755
---- a/config.sub
-+++ b/config.sub
-@@ -1357,6 +1357,7 @@ case $os in
- | -sym* | -kopensolaris* | -plan9* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
-+ | -barrelfish* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-diff --git a/configure b/configure
-index ee45e1b00f90..5bb841e5899d 100755
---- a/configure
-+++ b/configure
-@@ -2953,7 +2953,7 @@ case "${ENABLE_GOLD}" in
- *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
- | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
- | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
-- | *-*-solaris2* | *-*-nto* | *-*-nacl*)
-+ | *-*-solaris2* | *-*-nto* | *-*-nacl* | *-*-barrelfish*)
- case "${target}" in
- *-*-linux*aout* | *-*-linux*oldld*)
- ;;
-diff --git a/gas/configure.tgt b/gas/configure.tgt
-index 77c1d9b59246..5b32ae8f8a0c 100644
---- a/gas/configure.tgt
-+++ b/gas/configure.tgt
-@@ -270,6 +270,7 @@ case ${generic_target} in
- i386-*-chaos) fmt=elf ;;
- i386-*-rdos*) fmt=elf ;;
- i386-*-darwin*) fmt=macho ;;
-+ i386-*-barrelfish*) fmt=elf ;;
-
- i860-*-*) fmt=elf endian=little ;;
-
-diff --git a/ld/Makefile.am b/ld/Makefile.am
-index b2b2a6ebe362..c01570b158ba 100644
---- a/ld/Makefile.am
-+++ b/ld/Makefile.am
-@@ -263,6 +263,7 @@ ALL_EMULATION_SOURCES = \
- eelf32xstormy16.c \
- eelf32xtensa.c \
- eelf_i386.c \
-+ ebarrelfish_i386.c \
- eelf_i386_be.c \
- eelf_i386_chaos.c \
- eelf_i386_fbsd.c \
-@@ -522,6 +522,8 @@ ALL_64_EMULATION_SOURCES = \
- eelf_l1om_fbsd.c \
- eelf_k1om.c \
- eelf_k1om_fbsd.c \
-+ ebarrelfish_x86_64.c \
-+ ebarrelfish_k1om.c \
- eelf_x86_64.c \
- eelf_x86_64_fbsd.c \
- eelf_x86_64_nacl.c \
-@@ -1268,6 +1269,15 @@ eelf32xtensa.c: $(srcdir)/emulparams/elf32xtensa.sh $(ELF_DEPS) \
- eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_i386 "$(tdir_elf_i386)"
-+ebarrelfish_i386.c: $(srcdir)/emulparams/barrelfish_i386.sh \
-+ $(ELF_DEPS) $(srcdir)/scripttempl/elf-barrelfish.sc ${GEN_DEPENDS}
-+ ${GENSCRIPTS} barrelfish_i386 "$(tdir_barrelfish_i386)"
-+ebarrelfish_x86_64.c: $(srcdir)/emulparams/barrelfish_x86_64.sh \
-+ $(ELF_DEPS) $(srcdir)/scripttempl/elf-barrelfish.sc ${GEN_DEPENDS}
-+ ${GENSCRIPTS} barrelfish_x86_64 "$(tdir_barrelfish_x86_64)"
-+ebarrelfish_k1om.c: $(srcdir)/emulparams/barrelfish_k1om.sh \
-+ $(ELF_DEPS) $(srcdir)/scripttempl/elf-barrelfish.sc ${GEN_DEPENDS}
-+ ${GENSCRIPTS} barrelfish_k1om "$(tdir_barrelfish_k1om)"
- eelf_i386_be.c: $(srcdir)/emulparams/elf_i386_be.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_i386_be "$(tdir_elf_i386_be)"
-diff --git a/ld/Makefile.in b/ld/Makefile.in
-index b95a3d103de4..d41557b3334c 100644
---- a/ld/Makefile.in
-+++ b/ld/Makefile.in
-@@ -571,6 +571,7 @@ ALL_EMULATION_SOURCES = \
- eelf32xstormy16.c \
- eelf32xtensa.c \
- eelf_i386.c \
-+ ebarrelfish_i386.c \
- eelf_i386_be.c \
- eelf_i386_chaos.c \
- eelf_i386_fbsd.c \
-@@ -830,6 +832,8 @@ ALL_64_EMULATION_SOURCES = \
- eelf_k1om.c \
- eelf_k1om_fbsd.c \
- eelf_x86_64.c \
-+ ebarrelfish_x86_64.c \
-+ ebarrelfish_k1om.c \
- eelf_x86_64_fbsd.c \
- eelf_x86_64_nacl.c \
- eelf_x86_64_sol2.c \
-@@ -3619,6 +3621,15 @@ eelf_k1om_fbsd.c: $(srcdir)/emulparams/elf_k1om_fbsd.sh \
- $(srcdir)/emulparams/elf_k1om.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_k1om_fbsd "$(tdir_elf_k1om_fbsd)"
-+ebarrelfish_i386.c: $(srcdir)/emulparams/barrelfish_i386.sh \
-+ $(ELF_DEPS) $(srcdir)/scripttempl/elf-barrelfish.sc ${GEN_DEPENDS}
-+ ${GENSCRIPTS} barrelfish_i386 "$(tdir_barrelfish_i386)"
-+ebarrelfish_x86_64.c: $(srcdir)/emulparams/barrelfish_x86_64.sh \
-+ $(ELF_DEPS) $(srcdir)/scripttempl/elf-barrelfish.sc ${GEN_DEPENDS}
-+ ${GENSCRIPTS} barrelfish_x86_64 "$(tdir_barrelfish_x86_64)"
-+ebarrelfish_k1om.c: $(srcdir)/emulparams/barrelfish_k1om.sh \
-+ $(ELF_DEPS) $(srcdir)/scripttempl/elf-barrelfish.sc ${GEN_DEPENDS}
-+ ${GENSCRIPTS} barrelfish_k1om "$(tdir_barrelfish_k1om)"
- eelf_x86_64.c: $(srcdir)/emulparams/elf_x86_64.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_x86_64 "$(tdir_elf_x86_64)"
-diff --git a/ld/configure.tgt b/ld/configure.tgt
-index c50730b9c514..27702cbedc3a 100644
---- a/ld/configure.tgt
-+++ b/ld/configure.tgt
-@@ -224,6 +224,7 @@ i[3-7]86-*-bsd) targ_emul=i386bsd ;;
- i[3-7]86-*-bsd386) targ_emul=i386bsd ;;
- i[3-7]86-*-bsdi*) targ_emul=i386bsd ;;
- i[3-7]86-*-aout) targ_emul=i386aout ;;
-+i[3-7]86-*-barrelfish*) targ_emul=barrelfish_i386 ;;
- i[3-7]86-*-linux*aout*) targ_emul=i386linux
- targ_extra_emuls=elf_i386
- tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'` ;;
-@@ -244,6 +248,10 @@ x86_64-*-linux-*) targ_emul=elf_x86_64
- targ_extra_libpath="elf_i386 elf32_x86_64 elf_l1om elf_k1om"
- tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
- tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'` ;;
-+x86_64-k1om-barrelfish*) targ_emul=elf_k1om
-+ targ_extra_emuls="barrelfish_k1om barrelfish_x86_64 "
-+ targ_extra_libpath="elf_l1om barrelfish_k1om barrelfish_x86_64" ;;
-+x86_64-*-barrelfish*) targ_emul=barrelfish_x86_64 ;;
- i[3-7]86-*-sysv[45]*) targ_emul=elf_i386 ;;
- i[3-7]86-*-solaris2*) targ_emul=elf_i386_sol2
- targ_extra_emuls="elf_i386_ldso elf_i386 elf_x86_64_sol2 elf_x86_64 elf_l1om elf_k1om"
-diff --git a/ld/emulparams/barrelfish_i386.sh b/ld/emulparams/barrelfish_i386.sh
-new file mode 100644
-index 000000000000..032dd5ae18a3
---- /dev/null
-+++ b/ld/emulparams/barrelfish_i386.sh
-@@ -0,0 +1,14 @@
-+. ${srcdir}/emulparams/plt_unwind.sh
-+SCRIPT_NAME=elf-barrelfish
-+OUTPUT_FORMAT="elf32-i386"
-+NO_RELA_RELOCS=yes
-+TEXT_START_ADDR=0x400000
-+MAXPAGESIZE=0x1000
-+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
-+ARCH=i386
-+MACHINE=
-+TEMPLATE_NAME=elf32
-+GENERATE_SHLIB_SCRIPT=no
-+GENERATE_PIE_SCRIPT=yes
-+NO_SMALL_DATA=yes
-+SEPARATE_GOTPLT="SIZEOF (.got.plt) >= 12 ? 12 : 0"
-diff --git a/ld/emulparams/barrelfish_x86_64.sh b/ld/emulparams/barrelfish_x86_64.sh
-new file mode 100644
-index 000000000000..bf4dafdd6b2b
---- /dev/null
-+++ b/ld/emulparams/barrelfish_x86_64.sh
-@@ -0,0 +1,16 @@
-+. ${srcdir}/emulparams/plt_unwind.sh
-+SCRIPT_NAME=elf-barrelfish
-+ELFSIZE=64
-+OUTPUT_FORMAT="elf64-x86-64"
-+NO_RELA_RELOCS=yes
-+TEXT_START_ADDR=0x400000
-+MAXPAGESIZE=0x1000
-+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
-+ARCH="i386:x86-64"
-+MACHINE=
-+TEMPLATE_NAME=elf32
-+GENERATE_SHLIB_SCRIPT=no
-+GENERATE_PIE_SCRIPT=yes
-+NO_SMALL_DATA=yes
-+LARGE_SECTIONS=yes
-+SEPARATE_GOTPLT="SIZEOF (.got.plt) >= 24 ? 24 : 0"
-diff --git a/ld/emulparams/barrelfish_k1om.sh b/ld/emulparams/barrelfish_k1om.sh
-new file mode 100644
-index 000000000000..bf4dafdd6b2b
---- /dev/null
-+++ b/ld/emulparams/barrelfish_k1om.sh
-@@ -0,0 +1,17 @@
-+. ${srcdir}/emulparams/plt_unwind.sh
-+SCRIPT_NAME=elf-barrelfish
-+ELFSIZE=64
-+OUTPUT_FORMAT="elf64-k1om"
-+NO_RELA_RELOCS=yes
-+TEXT_START_ADDR=0x400000
-+MAXPAGESIZE=0x1000
-+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
-+ARCH="k1om"
-+MACHINE=
-+COMPILE_IN=yes
-+TEMPLATE_NAME=elf32
-+GENERATE_SHLIB_SCRIPT=yes
-+GENERATE_PIE_SCRIPT=yes
-+NO_SMALL_DATA=yes
-+LARGE_SECTIONS=yes
-+SEPARATE_GOTPLT="SIZEOF (.got.plt) >= 24 ? 24 : 0"
-diff --git a/ld/scripttempl/elf-barrelfish.sc b/ld/scripttempl/elf-barrelfish.sc
-new file mode 100644
-index 000000000000..51a655eed65c
---- /dev/null
-+++ b/ld/scripttempl/elf-barrelfish.sc
-@@ -0,0 +1,664 @@
-+#
-+# Unusual variables checked by this code:
-+# NOP - four byte opcode for no-op (defaults to none)
-+# NO_SMALL_DATA - no .sbss/.sbss2/.sdata/.sdata2 sections if not
-+# empty.
-+# SMALL_DATA_CTOR - .ctors contains small data.
-+# SMALL_DATA_DTOR - .dtors contains small data.
-+# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
-+# INITIAL_READONLY_SECTIONS - at start of text segment
-+# OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
-+# (e.g., .PARISC.milli)
-+# OTHER_TEXT_SECTIONS - these get put in .text when relocating
-+# OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
-+# (e.g., .PARISC.global)
-+# OTHER_RELRO_SECTIONS - other than .data.rel.ro ...
-+# (e.g. PPC32 .fixup, .got[12])
-+# OTHER_BSS_SECTIONS - other than .bss .sbss ...
-+# ATTRS_SECTIONS - at the end
-+# OTHER_SECTIONS - at the end
-+# EXECUTABLE_SYMBOLS - symbols that must be defined for an
-+# executable (e.g., _DYNAMIC_LINK)
-+# TEXT_START_ADDR - the first byte of the text segment, after any
-+# headers.
-+# TEXT_BASE_ADDRESS - the first byte of the text segment.
-+# TEXT_START_SYMBOLS - symbols that appear at the start of the
-+# .text section.
-+# DATA_START_SYMBOLS - symbols that appear at the start of the
-+# .data section.
-+# DATA_END_SYMBOLS - symbols that appear at the end of the
-+# writeable data sections.
-+# OTHER_GOT_SYMBOLS - symbols defined just before .got.
-+# OTHER_GOT_SECTIONS - sections just after .got.
-+# OTHER_SDATA_SECTIONS - sections just after .sdata.
-+# OTHER_BSS_SYMBOLS - symbols that appear at the start of the
-+# .bss section besides __bss_start.
-+# DATA_PLT - .plt should be in data segment, not text segment.
-+# PLT_BEFORE_GOT - .plt just before .got when .plt is in data segement.
-+# BSS_PLT - .plt should be in bss segment
-+# NO_REL_RELOCS - Don't include .rel.* sections in script
-+# NO_RELA_RELOCS - Don't include .rela.* sections in script
-+# NON_ALLOC_DYN - Place dynamic sections after data segment.
-+# TEXT_DYNAMIC - .dynamic in text segment, not data segment.
-+# EMBEDDED - whether this is for an embedded system.
-+# SHLIB_TEXT_START_ADDR - if set, add to SIZEOF_HEADERS to set
-+# start address of shared library.
-+# INPUT_FILES - INPUT command of files to always include
-+# WRITABLE_RODATA - if set, the .rodata section should be writable
-+# INIT_START, INIT_END - statements just before and just after
-+# combination of .init sections.
-+# FINI_START, FINI_END - statements just before and just after
-+# combination of .fini sections.
-+# STACK_ADDR - start of a .stack section.
-+# OTHER_SYMBOLS - symbols to place right at the end of the script.
-+# ETEXT_NAME - name of a symbol for the end of the text section,
-+# normally etext.
-+# SEPARATE_CODE - if set, .text and similar sections containing
-+# actual machine instructions must be in wholly disjoint
-+# pages from any other data, including headers
-+# SEPARATE_GOTPLT - if set, .got.plt should be separate output section,
-+# so that .got can be in the RELRO area. It should be set to
-+# the number of bytes in the beginning of .got.plt which can be
-+# in the RELRO area as well.
-+# USER_LABEL_PREFIX - prefix to add to user-visible symbols.
-+# RODATA_NAME, SDATA_NAME, SBSS_NAME, BSS_NAME - base parts of names
-+# for standard sections, without initial "." or suffixes.
-+#
-+# When adding sections, do note that the names of some sections are used
-+# when specifying the start address of the next.
-+#
-+
-+# Many sections come in three flavours. There is the 'real' section,
-+# like ".data". Then there are the per-procedure or per-variable
-+# sections, generated by -ffunction-sections and -fdata-sections in GCC,
-+# and useful for --gc-sections, which for a variable "foo" might be
-+# ".data.foo". Then there are the linkonce sections, for which the linker
-+# eliminates duplicates, which are named like ".gnu.linkonce.d.foo".
-+# The exact correspondences are:
-+#
-+# Section Linkonce section
-+# .text .gnu.linkonce.t.foo
-+# .rodata .gnu.linkonce.r.foo
-+# .data .gnu.linkonce.d.foo
-+# .bss .gnu.linkonce.b.foo
-+# .sdata .gnu.linkonce.s.foo
-+# .sbss .gnu.linkonce.sb.foo
-+# .sdata2 .gnu.linkonce.s2.foo
-+# .sbss2 .gnu.linkonce.sb2.foo
-+# .debug_info .gnu.linkonce.wi.foo
-+# .tdata .gnu.linkonce.td.foo
-+# .tbss .gnu.linkonce.tb.foo
-+# .lrodata .gnu.linkonce.lr.foo
-+# .ldata .gnu.linkonce.l.foo
-+# .lbss .gnu.linkonce.lb.foo
-+#
-+# Each of these can also have corresponding .rel.* and .rela.* sections.
-+
-+if test -n "$NOP"; then
-+ FILL="=$NOP"
-+else
-+ FILL=
-+fi
-+
-+test -z "$RODATA_NAME" && RODATA_NAME=rodata
-+test -z "$SDATA_NAME" && SDATA_NAME=sdata
-+test -z "$SBSS_NAME" && SBSS_NAME=sbss
-+test -z "$BSS_NAME" && BSS_NAME=bss
-+test -z "$ENTRY" && ENTRY=${USER_LABEL_PREFIX}_start
-+test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
-+test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
-+if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
-+test -z "${ELFSIZE}" && ELFSIZE=32
-+test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8"
-+test "$LD_FLAG" = "N" && DATA_ADDR=.
-+test -z "${ETEXT_NAME}" && ETEXT_NAME=${USER_LABEL_PREFIX}etext
-+test -n "$CREATE_SHLIB$CREATE_PIE" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE=""
-+test -z "$CREATE_SHLIB$CREATE_PIE" && test -n "$DATA_ADDR" && COMMONPAGESIZE=""
-+test -n "$RELRO_NOW" && unset SEPARATE_GOTPLT
-+test -z "$ATTRS_SECTIONS" && ATTRS_SECTIONS=".gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }"
-+DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))"
-+DATA_SEGMENT_RELRO_END=""
-+DATA_SEGMENT_END=""
-+if test -n "${COMMONPAGESIZE}"; then
-+ DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})"
-+ DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);"
-+ DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
-+fi
-+if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
-+ INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }"
-+fi
-+if test -z "$PLT"; then
-+ IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }"
-+ PLT=".plt ${RELOCATING-0} : { *(.plt)${IREL_IN_PLT+ *(.iplt)} }
-+ ${IREL_IN_PLT-$IPLT}"
-+fi
-+test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes
-+if test -z "$GOT"; then
-+ if test -z "$SEPARATE_GOTPLT"; then
-+ GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }"
-+ else
-+ GOT=".got ${RELOCATING-0} : { *(.got) *(.igot) }"
-+ GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) }"
-+ fi
-+fi
-+REL_IFUNC=".rel.ifunc ${RELOCATING-0} : { *(.rel.ifunc) }"
-+RELA_IFUNC=".rela.ifunc ${RELOCATING-0} : { *(.rela.ifunc) }"
-+REL_IPLT=".rel.iplt ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_start = .);}}
-+ *(.rel.iplt)
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_end = .);}}
-+ }"
-+RELA_IPLT=".rela.iplt ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_start = .);}}
-+ *(.rela.iplt)
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_end = .);}}
-+ }"
-+DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }"
-+RODATA=".${RODATA_NAME} ${RELOCATING-0} : { *(.${RODATA_NAME}${RELOCATING+ .${RODATA_NAME}.* .gnu.linkonce.r.*}) }"
-+DATARELRO=".data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }"
-+DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }"
-+if test -z "${NO_SMALL_DATA}"; then
-+ SBSS=".${SBSS_NAME} ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${SBSS_START_SYMBOLS}}
-+ ${CREATE_SHLIB+*(.${SBSS_NAME}2 .${SBSS_NAME}2.* .gnu.linkonce.sb2.*)}
-+ *(.dyn${SBSS_NAME})
-+ *(.${SBSS_NAME}${RELOCATING+ .${SBSS_NAME}.* .gnu.linkonce.sb.*})
-+ *(.scommon)
-+ ${RELOCATING+${SBSS_END_SYMBOLS}}
-+ }"
-+ SBSS2=".${SBSS_NAME}2 ${RELOCATING-0} : { *(.${SBSS_NAME}2${RELOCATING+ .${SBSS_NAME}2.* .gnu.linkonce.sb2.*}) }"
-+ SDATA="/* We want the small data sections together, so single-instruction offsets
-+ can access them all, and initialized data all before uninitialized, so
-+ we can shorten the on-disk segment size. */
-+ .${SDATA_NAME} ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${SDATA_START_SYMBOLS}}
-+ ${CREATE_SHLIB+*(.${SDATA_NAME}2 .${SDATA_NAME}2.* .gnu.linkonce.s2.*)}
-+ *(.${SDATA_NAME}${RELOCATING+ .${SDATA_NAME}.* .gnu.linkonce.s.*})
-+ }"
-+ SDATA2=".${SDATA_NAME}2 ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${SDATA2_START_SYMBOLS}}
-+ *(.${SDATA_NAME}2${RELOCATING+ .${SDATA_NAME}2.* .gnu.linkonce.s2.*})
-+ }"
-+ REL_SDATA=".rel.${SDATA_NAME} ${RELOCATING-0} : { *(.rel.${SDATA_NAME}${RELOCATING+ .rel.${SDATA_NAME}.* .rel.gnu.linkonce.s.*}) }
-+ .rela.${SDATA_NAME} ${RELOCATING-0} : { *(.rela.${SDATA_NAME}${RELOCATING+ .rela.${SDATA_NAME}.* .rela.gnu.linkonce.s.*}) }"
-+ REL_SBSS=".rel.${SBSS_NAME} ${RELOCATING-0} : { *(.rel.${SBSS_NAME}${RELOCATING+ .rel.${SBSS_NAME}.* .rel.gnu.linkonce.sb.*}) }
-+ .rela.${SBSS_NAME} ${RELOCATING-0} : { *(.rela.${SBSS_NAME}${RELOCATING+ .rela.${SBSS_NAME}.* .rela.gnu.linkonce.sb.*}) }"
-+ REL_SDATA2=".rel.${SDATA_NAME}2 ${RELOCATING-0} : { *(.rel.${SDATA_NAME}2${RELOCATING+ .rel.${SDATA_NAME}2.* .rel.gnu.linkonce.s2.*}) }
-+ .rela.${SDATA_NAME}2 ${RELOCATING-0} : { *(.rela.${SDATA_NAME}2${RELOCATING+ .rela.${SDATA_NAME}2.* .rela.gnu.linkonce.s2.*}) }"
-+ REL_SBSS2=".rel.${SBSS_NAME}2 ${RELOCATING-0} : { *(.rel.${SBSS_NAME}2${RELOCATING+ .rel.${SBSS_NAME}2.* .rel.gnu.linkonce.sb2.*}) }
-+ .rela.${SBSS_NAME}2 ${RELOCATING-0} : { *(.rela.${SBSS_NAME}2${RELOCATING+ .rela.${SBSS_NAME}2.* .rela.gnu.linkonce.sb2.*}) }"
-+else
-+ NO_SMALL_DATA=" "
-+fi
-+if test -z "${DATA_GOT}"; then
-+ if test -n "${NO_SMALL_DATA}"; then
-+ DATA_GOT=" "
-+ fi
-+fi
-+if test -z "${SDATA_GOT}"; then
-+ if test -z "${NO_SMALL_DATA}"; then
-+ SDATA_GOT=" "
-+ fi
-+fi
-+test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" "
-+test "${LARGE_SECTIONS}" = "yes" && REL_LARGE="
-+ .rel.ldata ${RELOCATING-0} : { *(.rel.ldata${RELOCATING+ .rel.ldata.* .rel.gnu.linkonce.l.*}) }
-+ .rela.ldata ${RELOCATING-0} : { *(.rela.ldata${RELOCATING+ .rela.ldata.* .rela.gnu.linkonce.l.*}) }
-+ .rel.lbss ${RELOCATING-0} : { *(.rel.lbss${RELOCATING+ .rel.lbss.* .rel.gnu.linkonce.lb.*}) }
-+ .rela.lbss ${RELOCATING-0} : { *(.rela.lbss${RELOCATING+ .rela.lbss.* .rela.gnu.linkonce.lb.*}) }
-+ .rel.lrodata ${RELOCATING-0} : { *(.rel.lrodata${RELOCATING+ .rel.lrodata.* .rel.gnu.linkonce.lr.*}) }
-+ .rela.lrodata ${RELOCATING-0} : { *(.rela.lrodata${RELOCATING+ .rela.lrodata.* .rela.gnu.linkonce.lr.*}) }"
-+test "${LARGE_SECTIONS}" = "yes" && OTHER_BSS_SECTIONS="
-+ ${OTHER_BSS_SECTIONS}
-+ .lbss ${RELOCATING-0} :
-+ {
-+ *(.dynlbss)
-+ *(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*})
-+ *(LARGE_COMMON)
-+ }"
-+test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
-+ .lrodata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
-+ {
-+ *(.lrodata${RELOCATING+ .lrodata.* .gnu.linkonce.lr.*})
-+ }
-+ .ldata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
-+ {
-+ *(.ldata${RELOCATING+ .ldata.* .gnu.linkonce.l.*})
-+ ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
-+ }"
-+if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then
-+ SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))"
-+ SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))"
-+ CTORS_IN_INIT_ARRAY="KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors))"
-+ DTORS_IN_FINI_ARRAY="KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors))"
-+else
-+ SORT_INIT_ARRAY="KEEP (*(SORT(.init_array.*)))"
-+ SORT_FINI_ARRAY="KEEP (*(SORT(.fini_array.*)))"
-+ CTORS_IN_INIT_ARRAY=
-+ DTORS_IN_FINI_ARRAY=
-+fi
-+INIT_ARRAY=".init_array ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_start = .);}}
-+ ${SORT_INIT_ARRAY}
-+ KEEP (*(.init_array))
-+ ${CTORS_IN_INIT_ARRAY}
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_end = .);}}
-+ }"
-+FINI_ARRAY=".fini_array ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_start = .);}}
-+ ${SORT_FINI_ARRAY}
-+ KEEP (*(.fini_array))
-+ ${DTORS_IN_FINI_ARRAY}
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_end = .);}}
-+ }"
-+CTOR=".ctors ${CONSTRUCTING-0} :
-+ {
-+ ${CONSTRUCTING+${CTOR_START}}
-+ /* gcc uses crtbegin.o to find the start of
-+ the constructors, so we make sure it is
-+ first. Because this is a wildcard, it
-+ doesn't matter if the user does not
-+ actually link against crtbegin.o; the
-+ linker won't look for a file to match a
-+ wildcard. The wildcard also means that it
-+ doesn't matter which directory crtbegin.o
-+ is in. */
-+
-+ KEEP (*crtbegin.o(.ctors))
-+ KEEP (*crtbegin?.o(.ctors))
-+
-+ /* We don't want to include the .ctor section from
-+ the crtend.o file until after the sorted ctors.
-+ The .ctor section from the crtend file contains the
-+ end of ctors marker and it must be last */
-+
-+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors))
-+ KEEP (*(SORT(.ctors.*)))
-+ KEEP (*(.ctors))
-+ ${CONSTRUCTING+${CTOR_END}}
-+ }"
-+DTOR=".dtors ${CONSTRUCTING-0} :
-+ {
-+ ${CONSTRUCTING+${DTOR_START}}
-+ KEEP (*crtbegin.o(.dtors))
-+ KEEP (*crtbegin?.o(.dtors))
-+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors))
-+ KEEP (*(SORT(.dtors.*)))
-+ KEEP (*(.dtors))
-+ ${CONSTRUCTING+${DTOR_END}}
-+ }"
-+STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} :
-+ {
-+ ${RELOCATING+${USER_LABEL_PREFIX}_stack = .;}
-+ *(.stack)
-+ }"
-+
-+TEXT_START_ADDR="SEGMENT_START(\"text-segment\", ${TEXT_START_ADDR})"
-+SHLIB_TEXT_START_ADDR="SEGMENT_START(\"text-segment\", ${SHLIB_TEXT_START_ADDR:-0})"
-+
-+if [ -z "$SEPARATE_CODE" ]; then
-+ SIZEOF_HEADERS_CODE=" + SIZEOF_HEADERS"
-+else
-+ SIZEOF_HEADERS_CODE=
-+fi
-+
-+# if this is for an embedded system, don't add SIZEOF_HEADERS.
-+if [ -z "$EMBEDDED" ]; then
-+ test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR}${SIZEOF_HEADERS_CODE}"
-+else
-+ test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR}"
-+fi
-+
-+cat <<EOF
-+OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
-+ "${LITTLE_OUTPUT_FORMAT}")
-+OUTPUT_ARCH(${OUTPUT_ARCH})
-+${RELOCATING+ENTRY(${ENTRY})}
-+
-+${RELOCATING+${LIB_SEARCH_DIRS}}
-+${RELOCATING+${EXECUTABLE_SYMBOLS}}
-+${RELOCATING+${INPUT_FILES}}
-+${RELOCATING- /* For some reason, the Solaris linker makes bad executables
-+ if gld -r is used and the intermediate file has sections starting
-+ at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
-+ bug. But for now assigning the zero vmas works. */}
-+
-+SECTIONS
-+{
-+ /* Read-only sections, merged into text segment: */
-+ ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}}
-+ ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR}${SIZEOF_HEADERS_CODE};}}
-+ ${CREATE_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR}${SIZEOF_HEADERS_CODE};}}
-+EOF
-+
-+emit_early_ro()
-+{
-+ cat <<EOF
-+ ${INITIAL_READONLY_SECTIONS}
-+ .note.gnu.build-id : { *(.note.gnu.build-id) }
-+EOF
-+}
-+
-+test -n "${SEPARATE_CODE}" || emit_early_ro
-+
-+test -n "${RELOCATING+0}" || unset NON_ALLOC_DYN
-+test -z "${NON_ALLOC_DYN}" || TEXT_DYNAMIC=
-+cat > ldscripts/dyntmp.$$ <<EOF
-+ ${TEXT_DYNAMIC+${DYNAMIC}}
-+ .hash ${RELOCATING-0} : { *(.hash) }
-+ .gnu.hash ${RELOCATING-0} : { *(.gnu.hash) }
-+ .dynsym ${RELOCATING-0} : { *(.dynsym) }
-+ .dynstr ${RELOCATING-0} : { *(.dynstr) }
-+ .gnu.version ${RELOCATING-0} : { *(.gnu.version) }
-+ .gnu.version_d ${RELOCATING-0}: { *(.gnu.version_d) }
-+ .gnu.version_r ${RELOCATING-0}: { *(.gnu.version_r) }
-+EOF
-+
-+if [ "x$COMBRELOC" = x ]; then
-+ COMBRELOCCAT="cat >> ldscripts/dyntmp.$$"
-+else
-+ COMBRELOCCAT="cat > $COMBRELOC"
-+fi
-+eval $COMBRELOCCAT <<EOF
-+ ${INITIAL_RELOC_SECTIONS}
-+ .rel.init ${RELOCATING-0} : { *(.rel.init) }
-+ .rela.init ${RELOCATING-0} : { *(.rela.init) }
-+ .rel.text ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) }
-+ .rela.text ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
-+ .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
-+ .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
-+ .rel.${RODATA_NAME} ${RELOCATING-0} : { *(.rel.${RODATA_NAME}${RELOCATING+ .rel.${RODATA_NAME}.* .rel.gnu.linkonce.r.*}) }
-+ .rela.${RODATA_NAME} ${RELOCATING-0} : { *(.rela.${RODATA_NAME}${RELOCATING+ .rela.${RODATA_NAME}.* .rela.gnu.linkonce.r.*}) }
-+ ${OTHER_READONLY_RELOC_SECTIONS}
-+ .rel.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+ .rel.data.rel.ro.* .rel.gnu.linkonce.d.rel.ro.*}) }
-+ .rela.data.rel.ro ${RELOCATING-0} : { *(.rela.data.rel.ro${RELOCATING+ .rela.data.rel.ro.* .rela.gnu.linkonce.d.rel.ro.*}) }
-+ .rel.data ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
-+ .rela.data ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
-+ ${OTHER_READWRITE_RELOC_SECTIONS}
-+ .rel.tdata ${RELOCATING-0} : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) }
-+ .rela.tdata ${RELOCATING-0} : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) }
-+ .rel.tbss ${RELOCATING-0} : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) }
-+ .rela.tbss ${RELOCATING-0} : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) }
-+ .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
-+ .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
-+ .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
-+ .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
-+ .rel.got ${RELOCATING-0} : { *(.rel.got) }
-+ .rela.got ${RELOCATING-0} : { *(.rela.got) }
-+ ${OTHER_GOT_RELOC_SECTIONS}
-+ ${REL_SDATA}
-+ ${REL_SBSS}
-+ ${REL_SDATA2}
-+ ${REL_SBSS2}
-+ .rel.${BSS_NAME} ${RELOCATING-0} : { *(.rel.${BSS_NAME}${RELOCATING+ .rel.${BSS_NAME}.* .rel.gnu.linkonce.b.*}) }
-+ .rela.${BSS_NAME} ${RELOCATING-0} : { *(.rela.${BSS_NAME}${RELOCATING+ .rela.${BSS_NAME}.* .rela.gnu.linkonce.b.*}) }
-+ ${REL_LARGE}
-+ ${IREL_IN_PLT+$REL_IFUNC}
-+ ${IREL_IN_PLT+$RELA_IFUNC}
-+ ${IREL_IN_PLT-$REL_IPLT}
-+ ${IREL_IN_PLT-$RELA_IPLT}
-+EOF
-+
-+if [ -n "$COMBRELOC" ]; then
-+cat >> ldscripts/dyntmp.$$ <<EOF
-+ .rel.dyn ${RELOCATING-0} :
-+ {
-+EOF
-+sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$
-+cat >> ldscripts/dyntmp.$$ <<EOF
-+ }
-+ .rela.dyn ${RELOCATING-0} :
-+ {
-+EOF
-+sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$
-+cat >> ldscripts/dyntmp.$$ <<EOF
-+ }
-+EOF
-+fi
-+
-+cat >> ldscripts/dyntmp.$$ <<EOF
-+ .rel.plt ${RELOCATING-0} :
-+ {
-+ *(.rel.plt)
-+ ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_start = .);}}}
-+ ${IREL_IN_PLT+${RELOCATING+*(.rel.iplt)}}
-+ ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_end = .);}}}
-+ }
-+ .rela.plt ${RELOCATING-0} :
-+ {
-+ *(.rela.plt)
-+ ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_start = .);}}}
-+ ${IREL_IN_PLT+${RELOCATING+*(.rela.iplt)}}
-+ ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_end = .);}}}
-+ }
-+ ${OTHER_PLT_RELOC_SECTIONS}
-+EOF
-+
-+emit_dyn()
-+{
-+ if test -z "${NO_REL_RELOCS}${NO_RELA_RELOCS}"; then
-+ cat ldscripts/dyntmp.$$
-+ else
-+ if test -z "${NO_REL_RELOCS}"; then
-+ sed -e '/^[ ]*\.rela\.[^}]*$/,/}/d' -e '/^[ ]*\.rela\./d' ldscripts/dyntmp.$$
-+ fi
-+ if test -z "${NO_RELA_RELOCS}"; then
-+ sed -e '/^[ ]*\.rel\.[^}]*$/,/}/d' -e '/^[ ]*\.rel\./d' ldscripts/dyntmp.$$
-+ fi
-+ fi
-+ rm -f ldscripts/dyntmp.$$
-+}
-+
-+test -n "${NON_ALLOC_DYN}${SEPARATE_CODE}" || emit_dyn
-+
-+cat <<EOF
-+ .init ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${INIT_START}}
-+ KEEP (*(SORT_NONE(.init)))
-+ ${RELOCATING+${INIT_END}}
-+ } ${FILL}
-+
-+ ${TEXT_PLT+${PLT}}
-+ ${TINY_READONLY_SECTION}
-+ .text ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${TEXT_START_SYMBOLS}}
-+ ${RELOCATING+*(.text.unlikely .text.*_unlikely)}
-+ ${RELOCATING+*(.text.exit .text.exit.*)}
-+ ${RELOCATING+*(.text.startup .text.startup.*)}
-+ ${RELOCATING+*(.text.hot .text.hot.*)}
-+ *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
-+ /* .gnu.warning sections are handled specially by elf32.em. */
-+ *(.gnu.warning)
-+ ${RELOCATING+${OTHER_TEXT_SECTIONS}}
-+ } ${FILL}
-+ .fini ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${FINI_START}}
-+ KEEP (*(SORT_NONE(.fini)))
-+ ${RELOCATING+${FINI_END}}
-+ } ${FILL}
-+ ${RELOCATING+PROVIDE (__${ETEXT_NAME} = .);}
-+ ${RELOCATING+PROVIDE (_${ETEXT_NAME} = .);}
-+ ${RELOCATING+PROVIDE (${ETEXT_NAME} = .);}
-+EOF
-+
-+if test -n "${SEPARATE_CODE}"; then
-+ cat <<EOF
-+ /* Adjust the address for the rodata segment. We want to adjust up to
-+ the same address within the page on the next page up. */
-+ ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${RODATA_ADDR-ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))};}}}
-+ ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_RODATA_ADDR-ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))};}}
-+ ${CREATE_PIE+${RELOCATING+. = ${SHLIB_RODATA_ADDR-ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))};}}
-+EOF
-+ emit_early_ro
-+ emit_dyn
-+fi
-+
-+cat <<EOF
-+ ${WRITABLE_RODATA-${RODATA}}
-+ .${RODATA_NAME}1 ${RELOCATING-0} : { *(.${RODATA_NAME}1) }
-+ ${CREATE_SHLIB-${SDATA2}}
-+ ${CREATE_SHLIB-${SBSS2}}
-+ ${OTHER_READONLY_SECTIONS}
-+ .eh_frame_hdr : { *(.eh_frame_hdr) }
-+ .eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
-+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table
-+ .gcc_except_table.*) }
-+ /* These sections are generated by the Sun/Oracle C++ compiler. */
-+ .exception_ranges ${RELOCATING-0} : ONLY_IF_RO { *(.exception_ranges
-+ .exception_ranges*) }
-+
-+ /* Adjust the address for the data segment. We want to adjust up to
-+ the same address within the page on the next page up. */
-+ ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}}
-+ ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
-+ ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
-+
-+ /* Exception handling */
-+ .eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
-+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
-+ .exception_ranges ${RELOCATING-0} : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
-+
-+ /* Thread Local Storage sections */
-+ .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
-+ .tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
-+
-+ .preinit_array ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_start = .);}}
-+ KEEP (*(.preinit_array))
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_end = .);}}
-+ }
-+ ${RELOCATING+${INIT_ARRAY}}
-+ ${RELOCATING+${FINI_ARRAY}}
-+ ${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
-+ ${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}}
-+ .jcr ${RELOCATING-0} : { KEEP (*(.jcr)) }
-+
-+ ${RELOCATING+${DATARELRO}}
-+ ${OTHER_RELRO_SECTIONS}
-+ ${TEXT_DYNAMIC-${DYNAMIC}}
-+ ${DATA_GOT+${RELRO_NOW+${GOT}}}
-+ ${DATA_GOT+${RELRO_NOW+${GOTPLT}}}
-+ ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT+${GOT}}}}
-+ ${RELOCATING+${DATA_SEGMENT_RELRO_END}}
-+ ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT-${GOT}}}}
-+ ${DATA_GOT+${RELRO_NOW-${GOTPLT}}}
-+
-+ ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}}
-+
-+ .data ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${DATA_START_SYMBOLS}}
-+ *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
-+ ${CONSTRUCTING+SORT(CONSTRUCTORS)}
-+ }
-+ .data1 ${RELOCATING-0} : { *(.data1) }
-+ ${WRITABLE_RODATA+${RODATA}}
-+ ${OTHER_READWRITE_SECTIONS}
-+ ${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}}
-+ ${SMALL_DATA_DTOR+${RELOCATING+${DTOR}}}
-+ ${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}}
-+ ${SDATA_GOT+${RELOCATING+${OTHER_GOT_SYMBOLS+. = .; ${OTHER_GOT_SYMBOLS}}}}
-+ ${SDATA_GOT+${GOT}}
-+ ${SDATA_GOT+${OTHER_GOT_SECTIONS}}
-+ ${SDATA}
-+ ${OTHER_SDATA_SECTIONS}
-+ ${RELOCATING+${DATA_END_SYMBOLS-${USER_LABEL_PREFIX}_edata = .; PROVIDE (${USER_LABEL_PREFIX}edata = .);}}
-+ ${RELOCATING+. = .;}
-+ ${RELOCATING+${USER_LABEL_PREFIX}__bss_start = .;}
-+ ${RELOCATING+${OTHER_BSS_SYMBOLS}}
-+ ${SBSS}
-+ ${BSS_PLT+${PLT}}
-+ .${BSS_NAME} ${RELOCATING-0} :
-+ {
-+ *(.dyn${BSS_NAME})
-+ *(.${BSS_NAME}${RELOCATING+ .${BSS_NAME}.* .gnu.linkonce.b.*})
-+ *(COMMON)
-+ /* Align here to ensure that the .bss section occupies space up to
-+ _end. Align after .bss to ensure correct alignment even if the
-+ .bss section disappears because there are no input sections.
-+ FIXME: Why do we need it? When there is no .bss section, we don't
-+ pad the .data section. */
-+ ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
-+ }
-+ ${OTHER_BSS_SECTIONS}
-+ ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
-+ ${RELOCATING+. = ALIGN(${ALIGNMENT});}
-+ ${LARGE_SECTIONS}
-+ ${RELOCATING+. = ALIGN(${ALIGNMENT});}
-+ ${RELOCATING+${OTHER_END_SYMBOLS}}
-+ ${RELOCATING+${END_SYMBOLS-${USER_LABEL_PREFIX}_end = .; PROVIDE (${USER_LABEL_PREFIX}end = .);}}
-+ ${RELOCATING+${DATA_SEGMENT_END}}
-+EOF
-+
-+test -z "${NON_ALLOC_DYN}" || emit_dyn
-+
-+cat <<EOF
-+ /* Stabs debugging sections. */
-+ .stab 0 : { *(.stab) }
-+ .stabstr 0 : { *(.stabstr) }
-+ .stab.excl 0 : { *(.stab.excl) }
-+ .stab.exclstr 0 : { *(.stab.exclstr) }
-+ .stab.index 0 : { *(.stab.index) }
-+ .stab.indexstr 0 : { *(.stab.indexstr) }
-+
-+ .comment 0 : { *(.comment) }
-+
-+ /* DWARF debug sections.
-+ Symbols in the DWARF debugging sections are relative to the beginning
-+ of the section so we begin them at 0. */
-+
-+ /* DWARF 1 */
-+ .debug 0 : { *(.debug) }
-+ .line 0 : { *(.line) }
-+
-+ /* GNU DWARF 1 extensions */
-+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
-+ .debug_sfnames 0 : { *(.debug_sfnames) }
-+
-+ /* DWARF 1.1 and DWARF 2 */
-+ .debug_aranges 0 : { *(.debug_aranges) }
-+ .debug_pubnames 0 : { *(.debug_pubnames) }
-+
-+ /* DWARF 2 */
-+ .debug_info 0 : { *(.debug_info${RELOCATING+ .gnu.linkonce.wi.*}) }
-+ .debug_abbrev 0 : { *(.debug_abbrev) }
-+ .debug_line 0 : { *(.debug_line) }
-+ .debug_frame 0 : { *(.debug_frame) }
-+ .debug_str 0 : { *(.debug_str) }
-+ .debug_loc 0 : { *(.debug_loc) }
-+ .debug_macinfo 0 : { *(.debug_macinfo) }
-+
-+ /* SGI/MIPS DWARF 2 extensions */
-+ .debug_weaknames 0 : { *(.debug_weaknames) }
-+ .debug_funcnames 0 : { *(.debug_funcnames) }
-+ .debug_typenames 0 : { *(.debug_typenames) }
-+ .debug_varnames 0 : { *(.debug_varnames) }
-+
-+ /* DWARF 3 */
-+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
-+ .debug_ranges 0 : { *(.debug_ranges) }
-+
-+ /* DWARF Extension. */
-+ .debug_macro 0 : { *(.debug_macro) }
-+
-+ ${TINY_DATA_SECTION}
-+ ${TINY_BSS_SECTION}
-+
-+ ${STACK_ADDR+${STACK}}
-+ ${ATTRS_SECTIONS}
-+ ${OTHER_SECTIONS}
-+ ${RELOCATING+${OTHER_SYMBOLS}}
-+ ${RELOCATING+${DISCARDED}}
-+}
-+EOF
+++ /dev/null
-diff --git a/bfd/config.bfd b/bfd/config.bfd
-index 5324d39a21cb..3f0119ab2649 100644
---- a/bfd/config.bfd
-+++ b/bfd/config.bfd
-@@ -630,6 +630,10 @@ case "${targ}" in
- targ64_selvecs="bfd_elf64_x86_64_nacl_vec bfd_elf32_x86_64_nacl_vec"
- targ_archs="$targ_archs bfd_arm_arch"
- ;;
-+ i[3-7]86-*-barrelfish*)
-+ targ_defvec=bfd_elf32_i386_vec
-+ targ_selvecs=bfd_elf32_i386_vec
-+ ;;
- #ifdef BFD64
- x86_64-*-darwin*)
- targ_defvec=mach_o_x86_64_vec
-@@ -673,6 +681,16 @@ case "${targ}" in
- targ_archs="$targ_archs bfd_arm_arch"
- want64=true
- ;;
-+ x86_64-k1om-barrelfish*)
-+ targ_defvec=bfd_elf64_k1om_vec
-+ targ_selvecs="bfd_elf32_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec bfd_elf64_x86_64_vec"
-+ want64=true
-+ ;;
-+ x86_64-*-barrelfish*)
-+ targ_defvec=bfd_elf64_x86_64_vec
-+ targ_selvecs=bfd_elf64_x86_64_vec
-+ want64=true
-+ ;;
- x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin)
- targ_defvec=x86_64pe_vec
- targ_selvecs="x86_64pe_vec x86_64pei_vec bfd_elf64_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec i386pe_vec i386pei_vec bfd_elf32_i386_vec"
-diff --git a/config.sub b/config.sub
-index 61cb4bc22db8..bc3ec8c48906 100755
---- a/config.sub
-+++ b/config.sub
-@@ -1357,6 +1357,7 @@ case $os in
- | -sym* | -kopensolaris* | -plan9* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
-+ | -barrelfish* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-diff --git a/configure b/configure
-index ee45e1b00f90..5bb841e5899d 100755
---- a/configure
-+++ b/configure
-@@ -2953,7 +2953,7 @@ case "${ENABLE_GOLD}" in
- *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
- | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
- | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
-- | *-*-solaris2* | *-*-nto* | *-*-nacl*)
-+ | *-*-solaris2* | *-*-nto* | *-*-nacl* | *-*-barrelfish*)
- case "${target}" in
- *-*-linux*aout* | *-*-linux*oldld*)
- ;;
-diff --git a/gas/configure.tgt b/gas/configure.tgt
-index 77c1d9b59246..5b32ae8f8a0c 100644
---- a/gas/configure.tgt
-+++ b/gas/configure.tgt
-@@ -270,6 +270,7 @@ case ${generic_target} in
- i386-*-chaos) fmt=elf ;;
- i386-*-rdos*) fmt=elf ;;
- i386-*-darwin*) fmt=macho ;;
-+ i386-*-barrelfish*) fmt=elf ;;
-
- i860-*-*) fmt=elf endian=little ;;
-
-diff --git a/ld/Makefile.am b/ld/Makefile.am
-index b2b2a6ebe362..c01570b158ba 100644
---- a/ld/Makefile.am
-+++ b/ld/Makefile.am
-@@ -263,6 +263,7 @@ ALL_EMULATION_SOURCES = \
- eelf32xstormy16.c \
- eelf32xtensa.c \
- eelf_i386.c \
-+ ebarrelfish_i386.c \
- eelf_i386_be.c \
- eelf_i386_chaos.c \
- eelf_i386_fbsd.c \
-@@ -522,6 +522,8 @@ ALL_64_EMULATION_SOURCES = \
- eelf_l1om_fbsd.c \
- eelf_k1om.c \
- eelf_k1om_fbsd.c \
-+ ebarrelfish_x86_64.c \
-+ ebarrelfish_k1om.c \
- eelf_x86_64.c \
- eelf_x86_64_fbsd.c \
- eelf_x86_64_nacl.c \
-@@ -1268,6 +1269,15 @@ eelf32xtensa.c: $(srcdir)/emulparams/elf32xtensa.sh $(ELF_DEPS) \
- eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_i386 "$(tdir_elf_i386)"
-+ebarrelfish_i386.c: $(srcdir)/emulparams/barrelfish_i386.sh \
-+ $(ELF_DEPS) $(srcdir)/scripttempl/elf-barrelfish.sc ${GEN_DEPENDS}
-+ ${GENSCRIPTS} barrelfish_i386 "$(tdir_barrelfish_i386)"
-+ebarrelfish_x86_64.c: $(srcdir)/emulparams/barrelfish_x86_64.sh \
-+ $(ELF_DEPS) $(srcdir)/scripttempl/elf-barrelfish.sc ${GEN_DEPENDS}
-+ ${GENSCRIPTS} barrelfish_x86_64 "$(tdir_barrelfish_x86_64)"
-+ebarrelfish_k1om.c: $(srcdir)/emulparams/barrelfish_k1om.sh \
-+ $(ELF_DEPS) $(srcdir)/scripttempl/elf-barrelfish.sc ${GEN_DEPENDS}
-+ ${GENSCRIPTS} barrelfish_k1om "$(tdir_barrelfish_k1om)"
- eelf_i386_be.c: $(srcdir)/emulparams/elf_i386_be.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_i386_be "$(tdir_elf_i386_be)"
-diff --git a/ld/Makefile.in b/ld/Makefile.in
-index b95a3d103de4..d41557b3334c 100644
---- a/ld/Makefile.in
-+++ b/ld/Makefile.in
-@@ -571,6 +571,7 @@ ALL_EMULATION_SOURCES = \
- eelf32xstormy16.c \
- eelf32xtensa.c \
- eelf_i386.c \
-+ ebarrelfish_i386.c \
- eelf_i386_be.c \
- eelf_i386_chaos.c \
- eelf_i386_fbsd.c \
-@@ -830,6 +832,8 @@ ALL_64_EMULATION_SOURCES = \
- eelf_k1om.c \
- eelf_k1om_fbsd.c \
- eelf_x86_64.c \
-+ ebarrelfish_x86_64.c \
-+ ebarrelfish_k1om.c \
- eelf_x86_64_fbsd.c \
- eelf_x86_64_nacl.c \
- eelf_x86_64_sol2.c \
-@@ -3619,6 +3621,15 @@ eelf_k1om_fbsd.c: $(srcdir)/emulparams/elf_k1om_fbsd.sh \
- $(srcdir)/emulparams/elf_k1om.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_k1om_fbsd "$(tdir_elf_k1om_fbsd)"
-+ebarrelfish_i386.c: $(srcdir)/emulparams/barrelfish_i386.sh \
-+ $(ELF_DEPS) $(srcdir)/scripttempl/elf-barrelfish.sc ${GEN_DEPENDS}
-+ ${GENSCRIPTS} barrelfish_i386 "$(tdir_barrelfish_i386)"
-+ebarrelfish_x86_64.c: $(srcdir)/emulparams/barrelfish_x86_64.sh \
-+ $(ELF_DEPS) $(srcdir)/scripttempl/elf-barrelfish.sc ${GEN_DEPENDS}
-+ ${GENSCRIPTS} barrelfish_x86_64 "$(tdir_barrelfish_x86_64)"
-+ebarrelfish_k1om.c: $(srcdir)/emulparams/barrelfish_k1om.sh \
-+ $(ELF_DEPS) $(srcdir)/scripttempl/elf-barrelfish.sc ${GEN_DEPENDS}
-+ ${GENSCRIPTS} barrelfish_k1om "$(tdir_barrelfish_k1om)"
- eelf_x86_64.c: $(srcdir)/emulparams/elf_x86_64.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_x86_64 "$(tdir_elf_x86_64)"
-diff --git a/ld/configure.tgt b/ld/configure.tgt
-index c50730b9c514..27702cbedc3a 100644
---- a/ld/configure.tgt
-+++ b/ld/configure.tgt
-@@ -224,6 +224,7 @@ i[3-7]86-*-bsd) targ_emul=i386bsd ;;
- i[3-7]86-*-bsd386) targ_emul=i386bsd ;;
- i[3-7]86-*-bsdi*) targ_emul=i386bsd ;;
- i[3-7]86-*-aout) targ_emul=i386aout ;;
-+i[3-7]86-*-barrelfish*) targ_emul=barrelfish_i386 ;;
- i[3-7]86-*-linux*aout*) targ_emul=i386linux
- targ_extra_emuls=elf_i386
- tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'` ;;
-@@ -244,6 +248,10 @@ x86_64-*-linux-*) targ_emul=elf_x86_64
- targ_extra_libpath="elf_i386 elf32_x86_64 elf_l1om elf_k1om"
- tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
- tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'` ;;
-+x86_64-k1om-barrelfish*) targ_emul=elf_k1om
-+ targ_extra_emuls="barrelfish_k1om barrelfish_x86_64 "
-+ targ_extra_libpath="elf_l1om barrelfish_k1om barrelfish_x86_64" ;;
-+x86_64-*-barrelfish*) targ_emul=barrelfish_x86_64 ;;
- i[3-7]86-*-sysv[45]*) targ_emul=elf_i386 ;;
- i[3-7]86-*-solaris2*) targ_emul=elf_i386_sol2
- targ_extra_emuls="elf_i386_ldso elf_i386 elf_x86_64_sol2 elf_x86_64 elf_l1om elf_k1om"
-diff --git a/ld/emulparams/barrelfish_i386.sh b/ld/emulparams/barrelfish_i386.sh
-new file mode 100644
-index 000000000000..032dd5ae18a3
---- /dev/null
-+++ b/ld/emulparams/barrelfish_i386.sh
-@@ -0,0 +1,14 @@
-+. ${srcdir}/emulparams/plt_unwind.sh
-+SCRIPT_NAME=elf-barrelfish
-+OUTPUT_FORMAT="elf32-i386"
-+NO_RELA_RELOCS=yes
-+TEXT_START_ADDR=0x400000
-+MAXPAGESIZE=0x1000
-+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
-+ARCH=i386
-+MACHINE=
-+TEMPLATE_NAME=elf32
-+GENERATE_SHLIB_SCRIPT=no
-+GENERATE_PIE_SCRIPT=yes
-+NO_SMALL_DATA=yes
-+SEPARATE_GOTPLT="SIZEOF (.got.plt) >= 12 ? 12 : 0"
-diff --git a/ld/emulparams/barrelfish_x86_64.sh b/ld/emulparams/barrelfish_x86_64.sh
-new file mode 100644
-index 000000000000..bf4dafdd6b2b
---- /dev/null
-+++ b/ld/emulparams/barrelfish_x86_64.sh
-@@ -0,0 +1,16 @@
-+. ${srcdir}/emulparams/plt_unwind.sh
-+SCRIPT_NAME=elf-barrelfish
-+ELFSIZE=64
-+OUTPUT_FORMAT="elf64-x86-64"
-+NO_RELA_RELOCS=yes
-+TEXT_START_ADDR=0x400000
-+MAXPAGESIZE=0x1000
-+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
-+ARCH="i386:x86-64"
-+MACHINE=
-+TEMPLATE_NAME=elf32
-+GENERATE_SHLIB_SCRIPT=no
-+GENERATE_PIE_SCRIPT=yes
-+NO_SMALL_DATA=yes
-+LARGE_SECTIONS=yes
-+SEPARATE_GOTPLT="SIZEOF (.got.plt) >= 24 ? 24 : 0"
-diff --git a/ld/emulparams/barrelfish_k1om.sh b/ld/emulparams/barrelfish_k1om.sh
-new file mode 100644
-index 000000000000..bf4dafdd6b2b
---- /dev/null
-+++ b/ld/emulparams/barrelfish_k1om.sh
-@@ -0,0 +1,17 @@
-+. ${srcdir}/emulparams/plt_unwind.sh
-+SCRIPT_NAME=elf-barrelfish
-+ELFSIZE=64
-+OUTPUT_FORMAT="elf64-k1om"
-+NO_RELA_RELOCS=yes
-+TEXT_START_ADDR=0x400000
-+MAXPAGESIZE=0x1000
-+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
-+ARCH="k1om"
-+MACHINE=
-+COMPILE_IN=yes
-+TEMPLATE_NAME=elf32
-+GENERATE_SHLIB_SCRIPT=yes
-+GENERATE_PIE_SCRIPT=yes
-+NO_SMALL_DATA=yes
-+LARGE_SECTIONS=yes
-+SEPARATE_GOTPLT="SIZEOF (.got.plt) >= 24 ? 24 : 0"
-diff --git a/ld/scripttempl/elf-barrelfish.sc b/ld/scripttempl/elf-barrelfish.sc
-new file mode 100644
-index 000000000000..51a655eed65c
---- /dev/null
-+++ b/ld/scripttempl/elf-barrelfish.sc
-@@ -0,0 +1,664 @@
-+#
-+# Unusual variables checked by this code:
-+# NOP - four byte opcode for no-op (defaults to none)
-+# NO_SMALL_DATA - no .sbss/.sbss2/.sdata/.sdata2 sections if not
-+# empty.
-+# SMALL_DATA_CTOR - .ctors contains small data.
-+# SMALL_DATA_DTOR - .dtors contains small data.
-+# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
-+# INITIAL_READONLY_SECTIONS - at start of text segment
-+# OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
-+# (e.g., .PARISC.milli)
-+# OTHER_TEXT_SECTIONS - these get put in .text when relocating
-+# OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
-+# (e.g., .PARISC.global)
-+# OTHER_RELRO_SECTIONS - other than .data.rel.ro ...
-+# (e.g. PPC32 .fixup, .got[12])
-+# OTHER_BSS_SECTIONS - other than .bss .sbss ...
-+# ATTRS_SECTIONS - at the end
-+# OTHER_SECTIONS - at the end
-+# EXECUTABLE_SYMBOLS - symbols that must be defined for an
-+# executable (e.g., _DYNAMIC_LINK)
-+# TEXT_START_ADDR - the first byte of the text segment, after any
-+# headers.
-+# TEXT_BASE_ADDRESS - the first byte of the text segment.
-+# TEXT_START_SYMBOLS - symbols that appear at the start of the
-+# .text section.
-+# DATA_START_SYMBOLS - symbols that appear at the start of the
-+# .data section.
-+# DATA_END_SYMBOLS - symbols that appear at the end of the
-+# writeable data sections.
-+# OTHER_GOT_SYMBOLS - symbols defined just before .got.
-+# OTHER_GOT_SECTIONS - sections just after .got.
-+# OTHER_SDATA_SECTIONS - sections just after .sdata.
-+# OTHER_BSS_SYMBOLS - symbols that appear at the start of the
-+# .bss section besides __bss_start.
-+# DATA_PLT - .plt should be in data segment, not text segment.
-+# PLT_BEFORE_GOT - .plt just before .got when .plt is in data segement.
-+# BSS_PLT - .plt should be in bss segment
-+# NO_REL_RELOCS - Don't include .rel.* sections in script
-+# NO_RELA_RELOCS - Don't include .rela.* sections in script
-+# NON_ALLOC_DYN - Place dynamic sections after data segment.
-+# TEXT_DYNAMIC - .dynamic in text segment, not data segment.
-+# EMBEDDED - whether this is for an embedded system.
-+# SHLIB_TEXT_START_ADDR - if set, add to SIZEOF_HEADERS to set
-+# start address of shared library.
-+# INPUT_FILES - INPUT command of files to always include
-+# WRITABLE_RODATA - if set, the .rodata section should be writable
-+# INIT_START, INIT_END - statements just before and just after
-+# combination of .init sections.
-+# FINI_START, FINI_END - statements just before and just after
-+# combination of .fini sections.
-+# STACK_ADDR - start of a .stack section.
-+# OTHER_SYMBOLS - symbols to place right at the end of the script.
-+# ETEXT_NAME - name of a symbol for the end of the text section,
-+# normally etext.
-+# SEPARATE_CODE - if set, .text and similar sections containing
-+# actual machine instructions must be in wholly disjoint
-+# pages from any other data, including headers
-+# SEPARATE_GOTPLT - if set, .got.plt should be separate output section,
-+# so that .got can be in the RELRO area. It should be set to
-+# the number of bytes in the beginning of .got.plt which can be
-+# in the RELRO area as well.
-+# USER_LABEL_PREFIX - prefix to add to user-visible symbols.
-+# RODATA_NAME, SDATA_NAME, SBSS_NAME, BSS_NAME - base parts of names
-+# for standard sections, without initial "." or suffixes.
-+#
-+# When adding sections, do note that the names of some sections are used
-+# when specifying the start address of the next.
-+#
-+
-+# Many sections come in three flavours. There is the 'real' section,
-+# like ".data". Then there are the per-procedure or per-variable
-+# sections, generated by -ffunction-sections and -fdata-sections in GCC,
-+# and useful for --gc-sections, which for a variable "foo" might be
-+# ".data.foo". Then there are the linkonce sections, for which the linker
-+# eliminates duplicates, which are named like ".gnu.linkonce.d.foo".
-+# The exact correspondences are:
-+#
-+# Section Linkonce section
-+# .text .gnu.linkonce.t.foo
-+# .rodata .gnu.linkonce.r.foo
-+# .data .gnu.linkonce.d.foo
-+# .bss .gnu.linkonce.b.foo
-+# .sdata .gnu.linkonce.s.foo
-+# .sbss .gnu.linkonce.sb.foo
-+# .sdata2 .gnu.linkonce.s2.foo
-+# .sbss2 .gnu.linkonce.sb2.foo
-+# .debug_info .gnu.linkonce.wi.foo
-+# .tdata .gnu.linkonce.td.foo
-+# .tbss .gnu.linkonce.tb.foo
-+# .lrodata .gnu.linkonce.lr.foo
-+# .ldata .gnu.linkonce.l.foo
-+# .lbss .gnu.linkonce.lb.foo
-+#
-+# Each of these can also have corresponding .rel.* and .rela.* sections.
-+
-+if test -n "$NOP"; then
-+ FILL="=$NOP"
-+else
-+ FILL=
-+fi
-+
-+test -z "$RODATA_NAME" && RODATA_NAME=rodata
-+test -z "$SDATA_NAME" && SDATA_NAME=sdata
-+test -z "$SBSS_NAME" && SBSS_NAME=sbss
-+test -z "$BSS_NAME" && BSS_NAME=bss
-+test -z "$ENTRY" && ENTRY=${USER_LABEL_PREFIX}_start
-+test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
-+test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
-+if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
-+test -z "${ELFSIZE}" && ELFSIZE=32
-+test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8"
-+test "$LD_FLAG" = "N" && DATA_ADDR=.
-+test -z "${ETEXT_NAME}" && ETEXT_NAME=${USER_LABEL_PREFIX}etext
-+test -n "$CREATE_SHLIB$CREATE_PIE" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE=""
-+test -z "$CREATE_SHLIB$CREATE_PIE" && test -n "$DATA_ADDR" && COMMONPAGESIZE=""
-+test -n "$RELRO_NOW" && unset SEPARATE_GOTPLT
-+test -z "$ATTRS_SECTIONS" && ATTRS_SECTIONS=".gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }"
-+DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))"
-+DATA_SEGMENT_RELRO_END=""
-+DATA_SEGMENT_END=""
-+if test -n "${COMMONPAGESIZE}"; then
-+ DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})"
-+ DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);"
-+ DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
-+fi
-+if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
-+ INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }"
-+fi
-+if test -z "$PLT"; then
-+ IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }"
-+ PLT=".plt ${RELOCATING-0} : { *(.plt)${IREL_IN_PLT+ *(.iplt)} }
-+ ${IREL_IN_PLT-$IPLT}"
-+fi
-+test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes
-+if test -z "$GOT"; then
-+ if test -z "$SEPARATE_GOTPLT"; then
-+ GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }"
-+ else
-+ GOT=".got ${RELOCATING-0} : { *(.got) *(.igot) }"
-+ GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) }"
-+ fi
-+fi
-+REL_IFUNC=".rel.ifunc ${RELOCATING-0} : { *(.rel.ifunc) }"
-+RELA_IFUNC=".rela.ifunc ${RELOCATING-0} : { *(.rela.ifunc) }"
-+REL_IPLT=".rel.iplt ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_start = .);}}
-+ *(.rel.iplt)
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_end = .);}}
-+ }"
-+RELA_IPLT=".rela.iplt ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_start = .);}}
-+ *(.rela.iplt)
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_end = .);}}
-+ }"
-+DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }"
-+RODATA=".${RODATA_NAME} ${RELOCATING-0} : { *(.${RODATA_NAME}${RELOCATING+ .${RODATA_NAME}.* .gnu.linkonce.r.*}) }"
-+DATARELRO=".data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }"
-+DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }"
-+if test -z "${NO_SMALL_DATA}"; then
-+ SBSS=".${SBSS_NAME} ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${SBSS_START_SYMBOLS}}
-+ ${CREATE_SHLIB+*(.${SBSS_NAME}2 .${SBSS_NAME}2.* .gnu.linkonce.sb2.*)}
-+ *(.dyn${SBSS_NAME})
-+ *(.${SBSS_NAME}${RELOCATING+ .${SBSS_NAME}.* .gnu.linkonce.sb.*})
-+ *(.scommon)
-+ ${RELOCATING+${SBSS_END_SYMBOLS}}
-+ }"
-+ SBSS2=".${SBSS_NAME}2 ${RELOCATING-0} : { *(.${SBSS_NAME}2${RELOCATING+ .${SBSS_NAME}2.* .gnu.linkonce.sb2.*}) }"
-+ SDATA="/* We want the small data sections together, so single-instruction offsets
-+ can access them all, and initialized data all before uninitialized, so
-+ we can shorten the on-disk segment size. */
-+ .${SDATA_NAME} ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${SDATA_START_SYMBOLS}}
-+ ${CREATE_SHLIB+*(.${SDATA_NAME}2 .${SDATA_NAME}2.* .gnu.linkonce.s2.*)}
-+ *(.${SDATA_NAME}${RELOCATING+ .${SDATA_NAME}.* .gnu.linkonce.s.*})
-+ }"
-+ SDATA2=".${SDATA_NAME}2 ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${SDATA2_START_SYMBOLS}}
-+ *(.${SDATA_NAME}2${RELOCATING+ .${SDATA_NAME}2.* .gnu.linkonce.s2.*})
-+ }"
-+ REL_SDATA=".rel.${SDATA_NAME} ${RELOCATING-0} : { *(.rel.${SDATA_NAME}${RELOCATING+ .rel.${SDATA_NAME}.* .rel.gnu.linkonce.s.*}) }
-+ .rela.${SDATA_NAME} ${RELOCATING-0} : { *(.rela.${SDATA_NAME}${RELOCATING+ .rela.${SDATA_NAME}.* .rela.gnu.linkonce.s.*}) }"
-+ REL_SBSS=".rel.${SBSS_NAME} ${RELOCATING-0} : { *(.rel.${SBSS_NAME}${RELOCATING+ .rel.${SBSS_NAME}.* .rel.gnu.linkonce.sb.*}) }
-+ .rela.${SBSS_NAME} ${RELOCATING-0} : { *(.rela.${SBSS_NAME}${RELOCATING+ .rela.${SBSS_NAME}.* .rela.gnu.linkonce.sb.*}) }"
-+ REL_SDATA2=".rel.${SDATA_NAME}2 ${RELOCATING-0} : { *(.rel.${SDATA_NAME}2${RELOCATING+ .rel.${SDATA_NAME}2.* .rel.gnu.linkonce.s2.*}) }
-+ .rela.${SDATA_NAME}2 ${RELOCATING-0} : { *(.rela.${SDATA_NAME}2${RELOCATING+ .rela.${SDATA_NAME}2.* .rela.gnu.linkonce.s2.*}) }"
-+ REL_SBSS2=".rel.${SBSS_NAME}2 ${RELOCATING-0} : { *(.rel.${SBSS_NAME}2${RELOCATING+ .rel.${SBSS_NAME}2.* .rel.gnu.linkonce.sb2.*}) }
-+ .rela.${SBSS_NAME}2 ${RELOCATING-0} : { *(.rela.${SBSS_NAME}2${RELOCATING+ .rela.${SBSS_NAME}2.* .rela.gnu.linkonce.sb2.*}) }"
-+else
-+ NO_SMALL_DATA=" "
-+fi
-+if test -z "${DATA_GOT}"; then
-+ if test -n "${NO_SMALL_DATA}"; then
-+ DATA_GOT=" "
-+ fi
-+fi
-+if test -z "${SDATA_GOT}"; then
-+ if test -z "${NO_SMALL_DATA}"; then
-+ SDATA_GOT=" "
-+ fi
-+fi
-+test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" "
-+test "${LARGE_SECTIONS}" = "yes" && REL_LARGE="
-+ .rel.ldata ${RELOCATING-0} : { *(.rel.ldata${RELOCATING+ .rel.ldata.* .rel.gnu.linkonce.l.*}) }
-+ .rela.ldata ${RELOCATING-0} : { *(.rela.ldata${RELOCATING+ .rela.ldata.* .rela.gnu.linkonce.l.*}) }
-+ .rel.lbss ${RELOCATING-0} : { *(.rel.lbss${RELOCATING+ .rel.lbss.* .rel.gnu.linkonce.lb.*}) }
-+ .rela.lbss ${RELOCATING-0} : { *(.rela.lbss${RELOCATING+ .rela.lbss.* .rela.gnu.linkonce.lb.*}) }
-+ .rel.lrodata ${RELOCATING-0} : { *(.rel.lrodata${RELOCATING+ .rel.lrodata.* .rel.gnu.linkonce.lr.*}) }
-+ .rela.lrodata ${RELOCATING-0} : { *(.rela.lrodata${RELOCATING+ .rela.lrodata.* .rela.gnu.linkonce.lr.*}) }"
-+test "${LARGE_SECTIONS}" = "yes" && OTHER_BSS_SECTIONS="
-+ ${OTHER_BSS_SECTIONS}
-+ .lbss ${RELOCATING-0} :
-+ {
-+ *(.dynlbss)
-+ *(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*})
-+ *(LARGE_COMMON)
-+ }"
-+test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
-+ .lrodata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
-+ {
-+ *(.lrodata${RELOCATING+ .lrodata.* .gnu.linkonce.lr.*})
-+ }
-+ .ldata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
-+ {
-+ *(.ldata${RELOCATING+ .ldata.* .gnu.linkonce.l.*})
-+ ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
-+ }"
-+if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then
-+ SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))"
-+ SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))"
-+ CTORS_IN_INIT_ARRAY="KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors))"
-+ DTORS_IN_FINI_ARRAY="KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors))"
-+else
-+ SORT_INIT_ARRAY="KEEP (*(SORT(.init_array.*)))"
-+ SORT_FINI_ARRAY="KEEP (*(SORT(.fini_array.*)))"
-+ CTORS_IN_INIT_ARRAY=
-+ DTORS_IN_FINI_ARRAY=
-+fi
-+INIT_ARRAY=".init_array ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_start = .);}}
-+ ${SORT_INIT_ARRAY}
-+ KEEP (*(.init_array))
-+ ${CTORS_IN_INIT_ARRAY}
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_end = .);}}
-+ }"
-+FINI_ARRAY=".fini_array ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_start = .);}}
-+ ${SORT_FINI_ARRAY}
-+ KEEP (*(.fini_array))
-+ ${DTORS_IN_FINI_ARRAY}
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_end = .);}}
-+ }"
-+CTOR=".ctors ${CONSTRUCTING-0} :
-+ {
-+ ${CONSTRUCTING+${CTOR_START}}
-+ /* gcc uses crtbegin.o to find the start of
-+ the constructors, so we make sure it is
-+ first. Because this is a wildcard, it
-+ doesn't matter if the user does not
-+ actually link against crtbegin.o; the
-+ linker won't look for a file to match a
-+ wildcard. The wildcard also means that it
-+ doesn't matter which directory crtbegin.o
-+ is in. */
-+
-+ KEEP (*crtbegin.o(.ctors))
-+ KEEP (*crtbegin?.o(.ctors))
-+
-+ /* We don't want to include the .ctor section from
-+ the crtend.o file until after the sorted ctors.
-+ The .ctor section from the crtend file contains the
-+ end of ctors marker and it must be last */
-+
-+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors))
-+ KEEP (*(SORT(.ctors.*)))
-+ KEEP (*(.ctors))
-+ ${CONSTRUCTING+${CTOR_END}}
-+ }"
-+DTOR=".dtors ${CONSTRUCTING-0} :
-+ {
-+ ${CONSTRUCTING+${DTOR_START}}
-+ KEEP (*crtbegin.o(.dtors))
-+ KEEP (*crtbegin?.o(.dtors))
-+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors))
-+ KEEP (*(SORT(.dtors.*)))
-+ KEEP (*(.dtors))
-+ ${CONSTRUCTING+${DTOR_END}}
-+ }"
-+STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} :
-+ {
-+ ${RELOCATING+${USER_LABEL_PREFIX}_stack = .;}
-+ *(.stack)
-+ }"
-+
-+TEXT_START_ADDR="SEGMENT_START(\"text-segment\", ${TEXT_START_ADDR})"
-+SHLIB_TEXT_START_ADDR="SEGMENT_START(\"text-segment\", ${SHLIB_TEXT_START_ADDR:-0})"
-+
-+if [ -z "$SEPARATE_CODE" ]; then
-+ SIZEOF_HEADERS_CODE=" + SIZEOF_HEADERS"
-+else
-+ SIZEOF_HEADERS_CODE=
-+fi
-+
-+# if this is for an embedded system, don't add SIZEOF_HEADERS.
-+if [ -z "$EMBEDDED" ]; then
-+ test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR}${SIZEOF_HEADERS_CODE}"
-+else
-+ test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR}"
-+fi
-+
-+cat <<EOF
-+OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
-+ "${LITTLE_OUTPUT_FORMAT}")
-+OUTPUT_ARCH(${OUTPUT_ARCH})
-+${RELOCATING+ENTRY(${ENTRY})}
-+
-+${RELOCATING+${LIB_SEARCH_DIRS}}
-+${RELOCATING+${EXECUTABLE_SYMBOLS}}
-+${RELOCATING+${INPUT_FILES}}
-+${RELOCATING- /* For some reason, the Solaris linker makes bad executables
-+ if gld -r is used and the intermediate file has sections starting
-+ at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
-+ bug. But for now assigning the zero vmas works. */}
-+
-+SECTIONS
-+{
-+ /* Read-only sections, merged into text segment: */
-+ ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}}
-+ ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR}${SIZEOF_HEADERS_CODE};}}
-+ ${CREATE_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR}${SIZEOF_HEADERS_CODE};}}
-+EOF
-+
-+emit_early_ro()
-+{
-+ cat <<EOF
-+ ${INITIAL_READONLY_SECTIONS}
-+ .note.gnu.build-id : { *(.note.gnu.build-id) }
-+EOF
-+}
-+
-+test -n "${SEPARATE_CODE}" || emit_early_ro
-+
-+test -n "${RELOCATING+0}" || unset NON_ALLOC_DYN
-+test -z "${NON_ALLOC_DYN}" || TEXT_DYNAMIC=
-+cat > ldscripts/dyntmp.$$ <<EOF
-+ ${TEXT_DYNAMIC+${DYNAMIC}}
-+ .hash ${RELOCATING-0} : { *(.hash) }
-+ .gnu.hash ${RELOCATING-0} : { *(.gnu.hash) }
-+ .dynsym ${RELOCATING-0} : { *(.dynsym) }
-+ .dynstr ${RELOCATING-0} : { *(.dynstr) }
-+ .gnu.version ${RELOCATING-0} : { *(.gnu.version) }
-+ .gnu.version_d ${RELOCATING-0}: { *(.gnu.version_d) }
-+ .gnu.version_r ${RELOCATING-0}: { *(.gnu.version_r) }
-+EOF
-+
-+if [ "x$COMBRELOC" = x ]; then
-+ COMBRELOCCAT="cat >> ldscripts/dyntmp.$$"
-+else
-+ COMBRELOCCAT="cat > $COMBRELOC"
-+fi
-+eval $COMBRELOCCAT <<EOF
-+ ${INITIAL_RELOC_SECTIONS}
-+ .rel.init ${RELOCATING-0} : { *(.rel.init) }
-+ .rela.init ${RELOCATING-0} : { *(.rela.init) }
-+ .rel.text ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) }
-+ .rela.text ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
-+ .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
-+ .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
-+ .rel.${RODATA_NAME} ${RELOCATING-0} : { *(.rel.${RODATA_NAME}${RELOCATING+ .rel.${RODATA_NAME}.* .rel.gnu.linkonce.r.*}) }
-+ .rela.${RODATA_NAME} ${RELOCATING-0} : { *(.rela.${RODATA_NAME}${RELOCATING+ .rela.${RODATA_NAME}.* .rela.gnu.linkonce.r.*}) }
-+ ${OTHER_READONLY_RELOC_SECTIONS}
-+ .rel.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+ .rel.data.rel.ro.* .rel.gnu.linkonce.d.rel.ro.*}) }
-+ .rela.data.rel.ro ${RELOCATING-0} : { *(.rela.data.rel.ro${RELOCATING+ .rela.data.rel.ro.* .rela.gnu.linkonce.d.rel.ro.*}) }
-+ .rel.data ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
-+ .rela.data ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
-+ ${OTHER_READWRITE_RELOC_SECTIONS}
-+ .rel.tdata ${RELOCATING-0} : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) }
-+ .rela.tdata ${RELOCATING-0} : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) }
-+ .rel.tbss ${RELOCATING-0} : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) }
-+ .rela.tbss ${RELOCATING-0} : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) }
-+ .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
-+ .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
-+ .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
-+ .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
-+ .rel.got ${RELOCATING-0} : { *(.rel.got) }
-+ .rela.got ${RELOCATING-0} : { *(.rela.got) }
-+ ${OTHER_GOT_RELOC_SECTIONS}
-+ ${REL_SDATA}
-+ ${REL_SBSS}
-+ ${REL_SDATA2}
-+ ${REL_SBSS2}
-+ .rel.${BSS_NAME} ${RELOCATING-0} : { *(.rel.${BSS_NAME}${RELOCATING+ .rel.${BSS_NAME}.* .rel.gnu.linkonce.b.*}) }
-+ .rela.${BSS_NAME} ${RELOCATING-0} : { *(.rela.${BSS_NAME}${RELOCATING+ .rela.${BSS_NAME}.* .rela.gnu.linkonce.b.*}) }
-+ ${REL_LARGE}
-+ ${IREL_IN_PLT+$REL_IFUNC}
-+ ${IREL_IN_PLT+$RELA_IFUNC}
-+ ${IREL_IN_PLT-$REL_IPLT}
-+ ${IREL_IN_PLT-$RELA_IPLT}
-+EOF
-+
-+if [ -n "$COMBRELOC" ]; then
-+cat >> ldscripts/dyntmp.$$ <<EOF
-+ .rel.dyn ${RELOCATING-0} :
-+ {
-+EOF
-+sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$
-+cat >> ldscripts/dyntmp.$$ <<EOF
-+ }
-+ .rela.dyn ${RELOCATING-0} :
-+ {
-+EOF
-+sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$
-+cat >> ldscripts/dyntmp.$$ <<EOF
-+ }
-+EOF
-+fi
-+
-+cat >> ldscripts/dyntmp.$$ <<EOF
-+ .rel.plt ${RELOCATING-0} :
-+ {
-+ *(.rel.plt)
-+ ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_start = .);}}}
-+ ${IREL_IN_PLT+${RELOCATING+*(.rel.iplt)}}
-+ ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_end = .);}}}
-+ }
-+ .rela.plt ${RELOCATING-0} :
-+ {
-+ *(.rela.plt)
-+ ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_start = .);}}}
-+ ${IREL_IN_PLT+${RELOCATING+*(.rela.iplt)}}
-+ ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_end = .);}}}
-+ }
-+ ${OTHER_PLT_RELOC_SECTIONS}
-+EOF
-+
-+emit_dyn()
-+{
-+ if test -z "${NO_REL_RELOCS}${NO_RELA_RELOCS}"; then
-+ cat ldscripts/dyntmp.$$
-+ else
-+ if test -z "${NO_REL_RELOCS}"; then
-+ sed -e '/^[ ]*\.rela\.[^}]*$/,/}/d' -e '/^[ ]*\.rela\./d' ldscripts/dyntmp.$$
-+ fi
-+ if test -z "${NO_RELA_RELOCS}"; then
-+ sed -e '/^[ ]*\.rel\.[^}]*$/,/}/d' -e '/^[ ]*\.rel\./d' ldscripts/dyntmp.$$
-+ fi
-+ fi
-+ rm -f ldscripts/dyntmp.$$
-+}
-+
-+test -n "${NON_ALLOC_DYN}${SEPARATE_CODE}" || emit_dyn
-+
-+cat <<EOF
-+ .init ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${INIT_START}}
-+ KEEP (*(SORT_NONE(.init)))
-+ ${RELOCATING+${INIT_END}}
-+ } ${FILL}
-+
-+ ${TEXT_PLT+${PLT}}
-+ ${TINY_READONLY_SECTION}
-+ .text ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${TEXT_START_SYMBOLS}}
-+ ${RELOCATING+*(.text.unlikely .text.*_unlikely)}
-+ ${RELOCATING+*(.text.exit .text.exit.*)}
-+ ${RELOCATING+*(.text.startup .text.startup.*)}
-+ ${RELOCATING+*(.text.hot .text.hot.*)}
-+ *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
-+ /* .gnu.warning sections are handled specially by elf32.em. */
-+ *(.gnu.warning)
-+ ${RELOCATING+${OTHER_TEXT_SECTIONS}}
-+ } ${FILL}
-+ .fini ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${FINI_START}}
-+ KEEP (*(SORT_NONE(.fini)))
-+ ${RELOCATING+${FINI_END}}
-+ } ${FILL}
-+ ${RELOCATING+PROVIDE (__${ETEXT_NAME} = .);}
-+ ${RELOCATING+PROVIDE (_${ETEXT_NAME} = .);}
-+ ${RELOCATING+PROVIDE (${ETEXT_NAME} = .);}
-+EOF
-+
-+if test -n "${SEPARATE_CODE}"; then
-+ cat <<EOF
-+ /* Adjust the address for the rodata segment. We want to adjust up to
-+ the same address within the page on the next page up. */
-+ ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${RODATA_ADDR-ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))};}}}
-+ ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_RODATA_ADDR-ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))};}}
-+ ${CREATE_PIE+${RELOCATING+. = ${SHLIB_RODATA_ADDR-ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))};}}
-+EOF
-+ emit_early_ro
-+ emit_dyn
-+fi
-+
-+cat <<EOF
-+ ${WRITABLE_RODATA-${RODATA}}
-+ .${RODATA_NAME}1 ${RELOCATING-0} : { *(.${RODATA_NAME}1) }
-+ ${CREATE_SHLIB-${SDATA2}}
-+ ${CREATE_SHLIB-${SBSS2}}
-+ ${OTHER_READONLY_SECTIONS}
-+ .eh_frame_hdr : { *(.eh_frame_hdr) }
-+ .eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
-+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table
-+ .gcc_except_table.*) }
-+ /* These sections are generated by the Sun/Oracle C++ compiler. */
-+ .exception_ranges ${RELOCATING-0} : ONLY_IF_RO { *(.exception_ranges
-+ .exception_ranges*) }
-+
-+ /* Adjust the address for the data segment. We want to adjust up to
-+ the same address within the page on the next page up. */
-+ ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}}
-+ ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
-+ ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
-+
-+ /* Exception handling */
-+ .eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
-+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
-+ .exception_ranges ${RELOCATING-0} : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
-+
-+ /* Thread Local Storage sections */
-+ .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
-+ .tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
-+
-+ .preinit_array ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_start = .);}}
-+ KEEP (*(.preinit_array))
-+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_end = .);}}
-+ }
-+ ${RELOCATING+${INIT_ARRAY}}
-+ ${RELOCATING+${FINI_ARRAY}}
-+ ${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
-+ ${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}}
-+ .jcr ${RELOCATING-0} : { KEEP (*(.jcr)) }
-+
-+ ${RELOCATING+${DATARELRO}}
-+ ${OTHER_RELRO_SECTIONS}
-+ ${TEXT_DYNAMIC-${DYNAMIC}}
-+ ${DATA_GOT+${RELRO_NOW+${GOT}}}
-+ ${DATA_GOT+${RELRO_NOW+${GOTPLT}}}
-+ ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT+${GOT}}}}
-+ ${RELOCATING+${DATA_SEGMENT_RELRO_END}}
-+ ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT-${GOT}}}}
-+ ${DATA_GOT+${RELRO_NOW-${GOTPLT}}}
-+
-+ ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}}
-+
-+ .data ${RELOCATING-0} :
-+ {
-+ ${RELOCATING+${DATA_START_SYMBOLS}}
-+ *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
-+ ${CONSTRUCTING+SORT(CONSTRUCTORS)}
-+ }
-+ .data1 ${RELOCATING-0} : { *(.data1) }
-+ ${WRITABLE_RODATA+${RODATA}}
-+ ${OTHER_READWRITE_SECTIONS}
-+ ${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}}
-+ ${SMALL_DATA_DTOR+${RELOCATING+${DTOR}}}
-+ ${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}}
-+ ${SDATA_GOT+${RELOCATING+${OTHER_GOT_SYMBOLS+. = .; ${OTHER_GOT_SYMBOLS}}}}
-+ ${SDATA_GOT+${GOT}}
-+ ${SDATA_GOT+${OTHER_GOT_SECTIONS}}
-+ ${SDATA}
-+ ${OTHER_SDATA_SECTIONS}
-+ ${RELOCATING+${DATA_END_SYMBOLS-${USER_LABEL_PREFIX}_edata = .; PROVIDE (${USER_LABEL_PREFIX}edata = .);}}
-+ ${RELOCATING+. = .;}
-+ ${RELOCATING+${USER_LABEL_PREFIX}__bss_start = .;}
-+ ${RELOCATING+${OTHER_BSS_SYMBOLS}}
-+ ${SBSS}
-+ ${BSS_PLT+${PLT}}
-+ .${BSS_NAME} ${RELOCATING-0} :
-+ {
-+ *(.dyn${BSS_NAME})
-+ *(.${BSS_NAME}${RELOCATING+ .${BSS_NAME}.* .gnu.linkonce.b.*})
-+ *(COMMON)
-+ /* Align here to ensure that the .bss section occupies space up to
-+ _end. Align after .bss to ensure correct alignment even if the
-+ .bss section disappears because there are no input sections.
-+ FIXME: Why do we need it? When there is no .bss section, we don't
-+ pad the .data section. */
-+ ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
-+ }
-+ ${OTHER_BSS_SECTIONS}
-+ ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
-+ ${RELOCATING+. = ALIGN(${ALIGNMENT});}
-+ ${LARGE_SECTIONS}
-+ ${RELOCATING+. = ALIGN(${ALIGNMENT});}
-+ ${RELOCATING+${OTHER_END_SYMBOLS}}
-+ ${RELOCATING+${END_SYMBOLS-${USER_LABEL_PREFIX}_end = .; PROVIDE (${USER_LABEL_PREFIX}end = .);}}
-+ ${RELOCATING+${DATA_SEGMENT_END}}
-+EOF
-+
-+test -z "${NON_ALLOC_DYN}" || emit_dyn
-+
-+cat <<EOF
-+ /* Stabs debugging sections. */
-+ .stab 0 : { *(.stab) }
-+ .stabstr 0 : { *(.stabstr) }
-+ .stab.excl 0 : { *(.stab.excl) }
-+ .stab.exclstr 0 : { *(.stab.exclstr) }
-+ .stab.index 0 : { *(.stab.index) }
-+ .stab.indexstr 0 : { *(.stab.indexstr) }
-+
-+ .comment 0 : { *(.comment) }
-+
-+ /* DWARF debug sections.
-+ Symbols in the DWARF debugging sections are relative to the beginning
-+ of the section so we begin them at 0. */
-+
-+ /* DWARF 1 */
-+ .debug 0 : { *(.debug) }
-+ .line 0 : { *(.line) }
-+
-+ /* GNU DWARF 1 extensions */
-+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
-+ .debug_sfnames 0 : { *(.debug_sfnames) }
-+
-+ /* DWARF 1.1 and DWARF 2 */
-+ .debug_aranges 0 : { *(.debug_aranges) }
-+ .debug_pubnames 0 : { *(.debug_pubnames) }
-+
-+ /* DWARF 2 */
-+ .debug_info 0 : { *(.debug_info${RELOCATING+ .gnu.linkonce.wi.*}) }
-+ .debug_abbrev 0 : { *(.debug_abbrev) }
-+ .debug_line 0 : { *(.debug_line) }
-+ .debug_frame 0 : { *(.debug_frame) }
-+ .debug_str 0 : { *(.debug_str) }
-+ .debug_loc 0 : { *(.debug_loc) }
-+ .debug_macinfo 0 : { *(.debug_macinfo) }
-+
-+ /* SGI/MIPS DWARF 2 extensions */
-+ .debug_weaknames 0 : { *(.debug_weaknames) }
-+ .debug_funcnames 0 : { *(.debug_funcnames) }
-+ .debug_typenames 0 : { *(.debug_typenames) }
-+ .debug_varnames 0 : { *(.debug_varnames) }
-+
-+ /* DWARF 3 */
-+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
-+ .debug_ranges 0 : { *(.debug_ranges) }
-+
-+ /* DWARF Extension. */
-+ .debug_macro 0 : { *(.debug_macro) }
-+
-+ ${TINY_DATA_SECTION}
-+ ${TINY_BSS_SECTION}
-+
-+ ${STACK_ADDR+${STACK}}
-+ ${ATTRS_SECTIONS}
-+ ${OTHER_SECTIONS}
-+ ${RELOCATING+${OTHER_SYMBOLS}}
-+ ${RELOCATING+${DISCARDED}}
-+}
-+EOF
+++ /dev/null
-#!/usr/bin/env bash
-
-# C/C++ toolchain build script for Barrelfish.
-# http://redmine.aluzina.org/projects/barrelfish/wiki/Toolchain_from_sources
-# http://wiki.barrelfish.org/CrossCompiler
-#
-# In order to build a toolchain you will need to install the following packages:
-# $ sudo apt-get install gcc g++ make patch bison flex texinfo
-#
-# These are also required but will be downloaded automatically during the build:
-# libgmp-dev, libmpc-dev, libmpfr-dev
-#
-# Optional (for Graphite optimizations): libcloog-ppl-dev.
-
-set -e # Die if any command fails.
-set -x # Trace each command before execution.
-
-BASEDIR=$(pwd)
-BASEDIR=/home/acreto
-
-
-export TARGET=x86_64-k1om-barrelfish
-
-# Path of your Barrelfish source and build tree.
-BARRELFISH_SOURCE=$BASEDIR/barrelfish.xeon-phi
-BARRELFISH_BUILD=$BASEDIR/barrelfish.xeon-phi/build
-
-# Modify these versions to match the corresponding patch.
-BINUTILS=binutils-2.24
-GCC=gcc-4.8.2
-
-
-# Directory this shell script is stored in.
-# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
-SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-
-# Paths to patches.
-BINUTILS_PATCH="${SCRIPT_DIR}/${BINUTILS}-barrelfish.patch"
-GCC_PATCH="${SCRIPT_DIR}/${GCC}-barrelfish.patch"
-
-#-------------------------------------------------------------------------------
-
-# Where the toolchain will be built and installed.
-# Note: the toolchain is specific to the Barrelfish tree mentioned above.
-TOOLCHAIN_PREFIX=${BARRELFISH_SOURCE}/toolchain
-
-
-
-#-------------------------------------------------------------------------------
-
-# Sanity checks.
-exit_with_error() { echo "error: $1" && exit 1; }
-[[ ! -d "${BARRELFISH_SOURCE}" ]] && \
- exit_with_error "Barrelfish source not found (${BARRELFISH_SOURCE})."
-[[ ! -d "${BARRELFISH_BUILD}" ]] && \
- exit_with_error "Barrelfish tree not found (${BARRELFISH_BUILD})."
-[[ -d "${TOOLCHAIN_PREFIX}" ]] && \
- exit_with_error "toolchain already built in ${TOOLCHAIN_PREFIX}."
-[[ ! -f "${BINUTILS_PATCH}" ]] && \
- exit_with_error "binutils patch not found (${BINUTILS_PATCH})."
-[[ ! -f "${GCC_PATCH}" ]] && \
- exit_with_error "GCC patch not found (${GCC_PATCH})."
-
-
-# Build the toolchain.
-export PATH=${PATH}:${TOOLCHAIN_PREFIX}/bin
-export PREFIX=${TOOLCHAIN_PREFIX}
-
-
-TOOLCHAIN_BUILD="$(mktemp -d --tmpdir barrelfish-toolchain-build.XXXXXXXXXX)"
-
-
-# Build parallelism
-MAKE_JOBS=
-if [[ -z "${MAKE_JOBS}" ]]; then
- # Guess a sensible value - default: #cores + 2.
- MAKE_JOBS=$(($(grep "^core id" /proc/cpuinfo | sort -u | wc -l) + 2))
-fi
-
-
-pushd "${TOOLCHAIN_BUILD}"
-
-# 1. binutils - GNU Binary Utilities
-wget "http://ftp.gnu.org/gnu/binutils/${BINUTILS}.tar.gz"
-tar xzvf ${BINUTILS}.tar.gz
-pushd ${BINUTILS}/
-patch -p1 < "${BINUTILS_PATCH}"
-popd # ${BINUTILS}/
-mkdir -p ${BINUTILS}-build/
-pushd ${BINUTILS}-build/
-../${BINUTILS}/configure \
- --prefix="${TOOLCHAIN_PREFIX}" \
- --target="${TARGET}" \
- --enable-threads \
- --enable-lto \
- --enable-plugins \
- --disable-nls
-make -j${MAKE_JOBS}
-make install-strip
-popd # ${BINUTILS}-build/
-
-# 2. GCC - GNU Compiler Collection
-wget "ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/${GCC}/${GCC}.tar.bz2"
-tar xjvf ${GCC}.tar.bz2
-pushd ${GCC}/
-source ./contrib/download_prerequisites
-# http://stackoverflow.com/questions/407523/escape-a-string-for-sed-search-pattern
-BF_SOURCE_ESCAPED=$(echo "${BARRELFISH_SOURCE}" | sed -e 's/[\/&]/\\&/g')
-BF_BUILD_ESCAPED=$(echo "${BARRELFISH_BUILD}" | sed -e 's/[\/&]/\\&/g')
-sed -r -e "s/\{\{BF_SRC\}\}/${BF_SOURCE_ESCAPED}/g" \
- -e "s/\{\{BF_BUILD\}\}/${BF_BUILD_ESCAPED}/g" \
- "${GCC_PATCH}" | patch -p1
-popd # ${GCC}/
-
-mkdir -p ${GCC}-build/
-pushd ${GCC}-build/
-../${GCC}/configure \
- --prefix="${TOOLCHAIN_PREFIX}" \
- --target="${TARGET}" \
- --enable-languages=c,c++ \
- --enable-initfini-array \
- --disable-nls \
- --disable-libssp \
- --with-newlib \
- --disable-multilib # from xeon phi inside cluster
-make -j$MAKE_JOBS
-make install-strip
-
-popd # ${GCC}-build/
-
-popd # ${TOOLCHAIN_BUILD}
-
-rm -rf "${TOOLCHAIN_BUILD}"
+++ /dev/null
-diff --git a/config.sub b/config.sub
-index 707e9e2efe8d..59dd372ec16c 100755
---- a/config.sub
-+++ b/config.sub
-@@ -1359,6 +1359,7 @@ case $os in
- | -sym* | -kopensolaris* | -plan9* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
-+ | -barrelfish* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-diff --git a/gcc/config.gcc b/gcc/config.gcc
-index 92d57ddf4fb3..8e794e895be0 100644
---- a/gcc/config.gcc
-+++ b/gcc/config.gcc
-@@ -683,6 +683,12 @@ case ${target} in
- tmake_file="${tmake_file} t-glibc"
- target_has_targetcm=yes
- ;;
-+*-*-barrelfish*)
-+ gas=yes
-+ gnu_ld=yes
-+ default_use_cxa_atexit=yes
-+ use_gcc_stdint=wrap
-+ ;;
- *-*-netbsd*)
- tmake_file="t-slibgcc"
- gas=yes
-@@ -1212,9 +1224,21 @@ x86_64-*-darwin*)
- i[34567]86-*-elf*)
- tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h"
- ;;
-+i[34567]86-pc-barrelfish*)
-+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/barrelfish-x86_32.h"
-+ ;;
-+i[34567]86-scc-barrelfish*)
-+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/barrelfish-scc.h"
-+ ;;
- x86_64-*-elf*)
- tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h"
- ;;
-+x86_64-k1om-barrelfish*)
-+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h i386/barrelfish-k1om.h"
-+ ;;
-+x86_64-*-barrelfish*)
-+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h i386/barrelfish-x86_64.h"
-+ ;;
- i[34567]86-*-rdos*)
- tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/rdos.h"
- ;;
-diff --git a/gcc/config/i386/barrelfish-scc.h b/gcc/config/i386/barrelfish-scc.h
-new file mode 100644
-index 000000000000..930451c4dcdb
---- /dev/null
-+++ b/gcc/config/i386/barrelfish-scc.h
-@@ -0,0 +1,72 @@
-+#define BF_SRC "{{BF_SRC}}"
-+#define BF_BUILD "{{BF_BUILD}}"
-+
-+#undef TARGET_OS_CPP_BUILTINS
-+#define TARGET_OS_CPP_BUILTINS() \
-+ do { \
-+ builtin_define ("BARRELFISH"); \
-+ builtin_define_std ("barrelfish"); \
-+ builtin_define_std ("unix"); \
-+ builtin_define_std ("scc"); \
-+ builtin_define ("CONFIG_LAZY_THC"); \
-+ builtin_define ("CONFIG_NEWLIB"); \
-+ builtin_define ("CONFIG_INTERCONNECT_DRIVER_LMP"); \
-+ builtin_define ("CONFIG_INTERCONNECT_DRIVER_UMP"); \
-+ builtin_define ("CONFIG_FLOUNDER_BACKEND_LMP"); \
-+ builtin_define ("CONFIG_FLOUNDER_BACKEND_UMP_IPI"); \
-+ builtin_define ("BF_BUILD_DIR=\"" BF_BUILD "\""); \
-+ builtin_define ("BF_SRC_DIR=\"" BF_SRC "\""); \
-+ builtin_assert ("system=barrelfish"); \
-+ builtin_assert ("system=unix"); \
-+ } while(0);
-+
-+#undef CC1_SPEC
-+#define CC1_SPEC "%(cc1_cpu) -mno-red-zone"
-+
-+/* Default #includes are defined in 'hake/ArchDefaults.hs' (see 'cStdIncs'). */
-+#undef CPP_SPEC
-+#define CPP_SPEC \
-+ "-isystem" BF_SRC "/include " \
-+ "-isystem" BF_SRC "/include/arch/scc " \
-+ "-isystem" BF_SRC "/include/arch/x86_32 " \
-+ "-isystem" BF_SRC "/lib/newlib/newlib/libc/include " \
-+ "-isystem" BF_SRC "/include/c " \
-+ "-isystem" BF_SRC "/include/target/x86_32 " \
-+ "-isystem" BF_SRC "/include/ipv4 " \
-+ "-isystem" BF_BUILD "/scc/include " \
-+ "-isystem" BF_BUILD "/scc/include/dev"
-+
-+/* Default libraries are specified in 'hake/ArchDefaults.hs' (see 'stdLibs').
-+ Follows the order given by 'libDeps' in '{BF_SRC}/hake/RuleDefs.hs'. */
-+#undef LIB_SPEC
-+#define LIB_SPEC \
-+ "-L" BF_BUILD "/scc/lib " \
-+ "-lbarrelfish " \
-+ "-loctopus_parser " \
-+ BF_BUILD "/scc/errors/errno.o " \
-+ "-lnewlib " \
-+ "-lposixcompat " \
-+ "-lvfs " \
-+ "-lahci " \
-+ "-lnfs " \
-+ "-llwip " \
-+ "-lbarrelfish " \
-+ "-lnewlib"
-+
-+#undef STARTFILE_SPEC
-+#define STARTFILE_SPEC \
-+ BF_BUILD "/scc/lib/crt0.o%s " \
-+ BF_BUILD "/scc/lib/crtbegin.o%s"
-+
-+#undef ENDFILE_SPEC
-+#define ENDFILE_SPEC \
-+ "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \
-+ "%{mpc32:crtprec32.o%s} " \
-+ "%{mpc64:crtprec64.o%s} " \
-+ "%{mpc80:crtprec80.o%s} " \
-+ BF_BUILD "/scc/lib/crtend.o%s " \
-+ "-lcollections"
-+
-+/* System header files are C++ ready so don't wrap in extern "C". */
-+#undef NO_IMPLICIT_EXTERN_C
-+#define NO_IMPLICIT_EXTERN_C 1
-diff --git a/gcc/config/i386/barrelfish-x86_32.h b/gcc/config/i386/barrelfish-x86_32.h
-new file mode 100644
-index 000000000000..84d0bf56721c
---- /dev/null
-+++ b/gcc/config/i386/barrelfish-x86_32.h
-@@ -0,0 +1,70 @@
-+#define BF_SRC "{{BF_SRC}}"
-+#define BF_BUILD "{{BF_BUILD}}"
-+
-+#undef TARGET_OS_CPP_BUILTINS
-+#define TARGET_OS_CPP_BUILTINS() \
-+ do { \
-+ builtin_define ("BARRELFISH"); \
-+ builtin_define_std ("barrelfish"); \
-+ builtin_define_std ("unix"); \
-+ builtin_define ("CONFIG_LAZY_THC"); \
-+ builtin_define ("CONFIG_NEWLIB"); \
-+ builtin_define ("CONFIG_INTERCONNECT_DRIVER_LMP"); \
-+ builtin_define ("CONFIG_INTERCONNECT_DRIVER_UMP"); \
-+ builtin_define ("CONFIG_FLOUNDER_BACKEND_LMP"); \
-+ builtin_define ("CONFIG_FLOUNDER_BACKEND_UMP"); \
-+ builtin_define ("BF_BUILD_DIR=\"" BF_BUILD "\""); \
-+ builtin_define ("BF_SRC_DIR=\"" BF_SRC "\""); \
-+ builtin_assert ("system=barrelfish"); \
-+ builtin_assert ("system=unix"); \
-+ } while(0);
-+
-+#undef CC1_SPEC
-+#define CC1_SPEC "%(cc1_cpu) -mno-red-zone"
-+
-+/* Default #includes are defined in 'hake/ArchDefaults.hs' (see 'cStdIncs'). */
-+#undef CPP_SPEC
-+#define CPP_SPEC \
-+ "-isystem" BF_SRC "/include " \
-+ "-isystem" BF_SRC "/include/arch/x86_32 " \
-+ "-isystem" BF_SRC "/lib/newlib/newlib/libc/include " \
-+ "-isystem" BF_SRC "/include/c " \
-+ "-isystem" BF_SRC "/include/target/x86_32 " \
-+ "-isystem" BF_SRC "/include/ipv4 " \
-+ "-isystem" BF_BUILD "/x86_32/include " \
-+ "-isystem" BF_BUILD "/x86_32/include/dev"
-+
-+/* Default libraries are specified in 'hake/ArchDefaults.hs' (see 'stdLibs').
-+ Follows the order given by 'libDeps' in '{BF_SRC}/hake/RuleDefs.hs'. */
-+#undef LIB_SPEC
-+#define LIB_SPEC \
-+ "-L" BF_BUILD "/x86_32/lib " \
-+ "-lbarrelfish " \
-+ "-loctopus_parser " \
-+ BF_BUILD "/x86_32/errors/errno.o " \
-+ "-lnewlib " \
-+ "-lposixcompat " \
-+ "-lvfs " \
-+ "-lahci " \
-+ "-lnfs " \
-+ "-llwip " \
-+ "-lbarrelfish " \
-+ "-lnewlib"
-+
-+#undef STARTFILE_SPEC
-+#define STARTFILE_SPEC \
-+ BF_BUILD "/x86_32/lib/crt0.o%s " \
-+ BF_BUILD "/x86_32/lib/crtbegin.o%s"
-+
-+#undef ENDFILE_SPEC
-+#define ENDFILE_SPEC \
-+ "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \
-+ "%{mpc32:crtprec32.o%s} " \
-+ "%{mpc64:crtprec64.o%s} " \
-+ "%{mpc80:crtprec80.o%s} " \
-+ BF_BUILD "/x86_32/lib/crtend.o%s " \
-+ "-lcollections"
-+
-+/* System header files are C++ ready so don't wrap in extern "C". */
-+#undef NO_IMPLICIT_EXTERN_C
-+#define NO_IMPLICIT_EXTERN_C 1
-diff --git a/gcc/config/i386/barrelfish-x86_64.h b/gcc/config/i386/barrelfish-x86_64.h
-new file mode 100644
-index 000000000000..8608b62b1019
---- /dev/null
-+++ b/gcc/config/i386/barrelfish-x86_64.h
-@@ -0,0 +1,70 @@
-+#define BF_SRC "{{BF_SRC}}"
-+#define BF_BUILD "{{BF_BUILD}}"
-+
-+#undef TARGET_OS_CPP_BUILTINS
-+#define TARGET_OS_CPP_BUILTINS() \
-+ do { \
-+ builtin_define ("BARRELFISH"); \
-+ builtin_define_std ("barrelfish"); \
-+ builtin_define_std ("unix"); \
-+ builtin_define ("CONFIG_LAZY_THC"); \
-+ builtin_define ("CONFIG_NEWLIB"); \
-+ builtin_define ("CONFIG_INTERCONNECT_DRIVER_LMP"); \
-+ builtin_define ("CONFIG_INTERCONNECT_DRIVER_UMP"); \
-+ builtin_define ("CONFIG_FLOUNDER_BACKEND_LMP"); \
-+ builtin_define ("CONFIG_FLOUNDER_BACKEND_UMP"); \
-+ builtin_define ("BF_BUILD_DIR=\"" BF_BUILD "\""); \
-+ builtin_define ("BF_SRC_DIR=\"" BF_SRC "\""); \
-+ builtin_assert ("system=barrelfish"); \
-+ builtin_assert ("system=unix"); \
-+ } while(0);
-+
-+#undef CC1_SPEC
-+#define CC1_SPEC "%(cc1_cpu) -mno-red-zone"
-+
-+/* Default #includes are defined in 'hake/ArchDefaults.hs' (see 'cStdIncs'). */
-+#undef CPP_SPEC
-+#define CPP_SPEC \
-+ "-isystem" BF_SRC "/include " \
-+ "-isystem" BF_SRC "/include/arch/x86_64 " \
-+ "-isystem" BF_SRC "/lib/newlib/newlib/libc/include " \
-+ "-isystem" BF_SRC "/include/c " \
-+ "-isystem" BF_SRC "/include/target/x86_64 " \
-+ "-isystem" BF_SRC "/include/ipv4 " \
-+ "-isystem" BF_BUILD "/x86_64/include " \
-+ "-isystem" BF_BUILD "/x86_64/include/dev"
-+
-+/* Default libraries are specified in 'hake/ArchDefaults.hs' (see 'stdLibs').
-+ Follows the order given by 'libDeps' in '{BF_SRC}/hake/RuleDefs.hs'. */
-+#undef LIB_SPEC
-+#define LIB_SPEC \
-+ "-L" BF_BUILD "/x86_64/lib " \
-+ "-lbarrelfish " \
-+ "-loctopus_parser " \
-+ BF_BUILD "/x86_64/errors/errno.o " \
-+ "-lnewlib " \
-+ "-lposixcompat " \
-+ "-lvfs " \
-+ "-lahci " \
-+ "-lnfs " \
-+ "-llwip " \
-+ "-lbarrelfish " \
-+ "-lnewlib"
-+
-+#undef STARTFILE_SPEC
-+#define STARTFILE_SPEC \
-+ BF_BUILD "/x86_64/lib/crt0.o%s " \
-+ BF_BUILD "/x86_64/lib/crtbegin.o%s"
-+
-+#undef ENDFILE_SPEC
-+#define ENDFILE_SPEC \
-+ "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \
-+ "%{mpc32:crtprec32.o%s} " \
-+ "%{mpc64:crtprec64.o%s} " \
-+ "%{mpc80:crtprec80.o%s} " \
-+ BF_BUILD "/x86_64/lib/crtend.o%s " \
-+ "-lcollections"
-+
-+/* System header files are C++ ready so don't wrap in extern "C". */
-+#undef NO_IMPLICIT_EXTERN_C
-+#define NO_IMPLICIT_EXTERN_C 1
-diff --git a/gcc/config/i386/barrelfish-k1om.h b/gcc/config/i386/barrelfish-k1om.h
-new file mode 100644
-index 000000000000..8608b62b1019
---- /dev/null
-+++ b/gcc/config/i386/barrelfish-k1om.h
-@@ -0,0 +1,70 @@
-+#define BF_SRC "{{BF_SRC}}"
-+#define BF_BUILD "{{BF_BUILD}}"
-+
-+#undef TARGET_OS_CPP_BUILTINS
-+#define TARGET_OS_CPP_BUILTINS() \
-+ do { \
-+ builtin_define ("BARRELFISH"); \
-+ builtin_define_std ("barrelfish"); \
-+ builtin_define_std ("unix"); \
-+ builtin_define ("CONFIG_LAZY_THC"); \
-+ builtin_define ("CONFIG_NEWLIB"); \
-+ builtin_define ("CONFIG_INTERCONNECT_DRIVER_LMP"); \
-+ builtin_define ("CONFIG_INTERCONNECT_DRIVER_UMP"); \
-+ builtin_define ("CONFIG_FLOUNDER_BACKEND_LMP"); \
-+ builtin_define ("CONFIG_FLOUNDER_BACKEND_UMP"); \
-+ builtin_define ("BF_BUILD_DIR=\"" BF_BUILD "\""); \
-+ builtin_define ("BF_SRC_DIR=\"" BF_SRC "\""); \
-+ builtin_assert ("system=barrelfish"); \
-+ builtin_assert ("system=unix"); \
-+ } while(0);
-+
-+#undef CC1_SPEC
-+#define CC1_SPEC "%(cc1_cpu) -mno-red-zone"
-+
-+/* Default #includes are defined in 'hake/ArchDefaults.hs' (see 'cStdIncs'). */
-+#undef CPP_SPEC
-+#define CPP_SPEC \
-+ "-isystem" BF_SRC "/include " \
-+ "-isystem" BF_SRC "/include/arch/k1om " \
-+ "-isystem" BF_SRC "/lib/newlib/newlib/libc/include " \
-+ "-isystem" BF_SRC "/include/c " \
-+ "-isystem" BF_SRC "/include/target/k1om " \
-+ "-isystem" BF_SRC "/include/ipv4 " \
-+ "-isystem" BF_BUILD "/k1om/include " \
-+ "-isystem" BF_BUILD "/k1om/include/dev"
-+
-+/* Default libraries are specified in 'hake/ArchDefaults.hs' (see 'stdLibs').
-+ Follows the order given by 'libDeps' in '{BF_SRC}/hake/RuleDefs.hs'. */
-+#undef LIB_SPEC
-+#define LIB_SPEC \
-+ "-L" BF_BUILD "/k1om/lib " \
-+ "-lbarrelfish " \
-+ "-loctopus_parser " \
-+ BF_BUILD "/k1om/errors/errno.o " \
-+ "-lnewlib " \
-+ "-lposixcompat " \
-+ "-lvfs " \
-+ "-lahci " \
-+ "-lnfs " \
-+ "-llwip " \
-+ "-lbarrelfish " \
-+ "-lnewlib"
-+
-+#undef STARTFILE_SPEC
-+#define STARTFILE_SPEC \
-+ BF_BUILD "/k1om/lib/crt0.o%s " \
-+ BF_BUILD "/k1om/lib/crtbegin.o%s"
-+
-+#undef ENDFILE_SPEC
-+#define ENDFILE_SPEC \
-+ "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \
-+ "%{mpc32:crtprec32.o%s} " \
-+ "%{mpc64:crtprec64.o%s} " \
-+ "%{mpc80:crtprec80.o%s} " \
-+ BF_BUILD "/k1om/lib/crtend.o%s " \
-+ "-lcollections"
-+
-+/* System header files are C++ ready so don't wrap in extern "C". */
-+#undef NO_IMPLICIT_EXTERN_C
-+#define NO_IMPLICIT_EXTERN_C 1
-diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h
-index b04dd659abd8..4fe4906df44e 100644
---- a/gcc/ginclude/stddef.h
-+++ b/gcc/ginclude/stddef.h
-@@ -198,7 +198,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
- #define _GCC_SIZE_T
- #define _SIZET_
- #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
-- || defined(__FreeBSD_kernel__)
-+ || defined(__FreeBSD_kernel__) || defined(__barrelfish__)
- /* __size_t is a typedef on FreeBSD 5, must not trash it. */
- #elif defined (__VMS__)
- /* __size_t is also a typedef on VMS. */
-diff --git a/gcc/testsuite/g++.dg/dg.exp b/gcc/testsuite/g++.dg/dg.exp
-index 720135942bbf..e65f8891ef1e 100644
---- a/gcc/testsuite/g++.dg/dg.exp
-+++ b/gcc/testsuite/g++.dg/dg.exp
-@@ -31,6 +31,7 @@ dg-init
- # Gather a list of all tests, with the exception of those in directories
- # that are handled specially.
- set tests [lsort [find $srcdir/$subdir *.C]]
-+set tests [prune $tests $srcdir/$subdir/eh/*]
- set tests [prune $tests $srcdir/$subdir/bprob/*]
- set tests [prune $tests $srcdir/$subdir/charset/*]
- set tests [prune $tests $srcdir/$subdir/compat/*]
-diff --git a/libgcc/config.host b/libgcc/config.host
-index 259c9a725f98..609b6a541c4f 100644
---- a/libgcc/config.host
-+++ b/libgcc/config.host
-@@ -199,6 +199,10 @@ case ${host} in
- tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux"
- extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
- ;;
-+*-*-barrelfish*)
-+ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip"
-+ extra_parts="crtbegin.o crtend.o"
-+ ;;
- *-*-lynxos*)
- tmake_file="$tmake_file t-lynx $cpu_type/t-crtstuff t-crtstuff-pic t-libgcc-pic"
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
-@@ -523,6 +527,10 @@ i[34567]86-*-linux*)
- tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
- md_unwind_header=i386/linux-unwind.h
- ;;
-+i[34567]86-*-barrelfish*)
-+ extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
-+ tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
-+ ;;
- i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)
- extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
- tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
-@@ -532,6 +544,14 @@ x86_64-*-linux*)
- tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
- md_unwind_header=i386/linux-unwind.h
- ;;
-+x86_64-k1om-barrelfish*)
-+ extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
-+ tmake_file="${tmake_file} i386/t-crtpc i386/t-mic-crtfm i386/${host_address}/t-mic-fprules-softfp i386/t-crtstuff"
-+ ;;
-+x86_64-*-barrelfish*)
-+ extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
-+ tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
-+ ;;
- x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
- extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
- tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
-diff --git a/libiberty/clock.c b/libiberty/clock.c
-index 07d902e8a160..4d5817a30cf9 100644
---- a/libiberty/clock.c
-+++ b/libiberty/clock.c
-@@ -66,7 +66,7 @@ number of seconds used.
-
- /* FIXME: should be able to declare as clock_t. */
-
--long
-+clock_t
- clock (void)
- {
- #ifdef HAVE_GETRUSAGE
-diff --git a/libiberty/gettimeofday.c b/libiberty/gettimeofday.c
-index fca16794028e..88f2f5ae70d3 100644
---- a/libiberty/gettimeofday.c
-+++ b/libiberty/gettimeofday.c
-@@ -19,7 +19,7 @@ that @var{tz} be NULL. Returns 0 on success, -1 on failure.
- */
-
- int
--gettimeofday (struct timeval *tp, void *tz)
-+gettimeofday (struct timeval *tp, struct timezone *tz)
- {
- if (tz)
- abort ();
-diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
-index 57452f7fe590..1a1cfd4a6cfa 100755
---- a/libstdc++-v3/configure
-+++ b/libstdc++-v3/configure
-@@ -52461,6 +52461,5983 @@ _ACEOF
- fi
-
- ;;
-+ *-barrelfish*)
-+
-+ # All these tests are for C++; save the language and the compiler flags.
-+ # The CXXFLAGS thing is suspicious, but based on similar bits previously
-+ # found in GLIBCXX_CONFIGURE.
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ ac_test_CXXFLAGS="${CXXFLAGS+set}"
-+ ac_save_CXXFLAGS="$CXXFLAGS"
-+
-+ # Check for maintainer-mode bits.
-+ if test x"$USE_MAINTAINER_MODE" = xno; then
-+ WERROR=''
-+ else
-+ WERROR='-Werror'
-+ fi
-+
-+ # Check for -ffunction-sections -fdata-sections
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for g++ that supports -ffunction-sections -fdata-sections" >&5
-+$as_echo_n "checking for g++ that supports -ffunction-sections -fdata-sections... " >&6; }
-+ CXXFLAGS='-g -Werror -ffunction-sections -fdata-sections'
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+int foo; void bar() { };
-+int
-+main ()
-+{
-+
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ ac_fdsections=yes
-+else
-+ ac_fdsections=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ if test "$ac_test_CXXFLAGS" = set; then
-+ CXXFLAGS="$ac_save_CXXFLAGS"
-+ else
-+ # this is the suspicious part
-+ CXXFLAGS=''
-+ fi
-+ if test x"$ac_fdsections" = x"yes"; then
-+ SECTION_FLAGS='-ffunction-sections -fdata-sections'
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_fdsections" >&5
-+$as_echo "$ac_fdsections" >&6; }
-+
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+
-+
-+
-+ # If we're not using GNU ld, then there's no point in even trying these
-+ # tests. Check for that first. We should have already tested for gld
-+ # by now (in libtool), but require it now just to be safe...
-+ test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
-+ test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
-+
-+
-+
-+ # The name set by libtool depends on the version of libtool. Shame on us
-+ # for depending on an impl detail, but c'est la vie. Older versions used
-+ # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
-+ # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
-+ # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
-+ # set (hence we're using an older libtool), then set it.
-+ if test x${with_gnu_ld+set} != xset; then
-+ if test x${ac_cv_prog_gnu_ld+set} != xset; then
-+ # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
-+ with_gnu_ld=no
-+ else
-+ with_gnu_ld=$ac_cv_prog_gnu_ld
-+ fi
-+ fi
-+
-+ # Start by getting the version number. I think the libtool test already
-+ # does some of this, but throws away the result.
-+ glibcxx_ld_is_gold=no
-+ if test x"$with_gnu_ld" = x"yes"; then
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
-+$as_echo_n "checking for ld version... " >&6; }
-+
-+ if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
-+ glibcxx_ld_is_gold=yes
-+ fi
-+ ldver=`$LD --version 2>/dev/null |
-+ sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
-+
-+ glibcxx_gnu_ld_version=`echo $ldver | \
-+ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_gnu_ld_version" >&5
-+$as_echo "$glibcxx_gnu_ld_version" >&6; }
-+ fi
-+
-+ # Set --gc-sections.
-+ glibcxx_have_gc_sections=no
-+ if test "$glibcxx_ld_is_gold" = "yes"; then
-+ if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
-+ glibcxx_have_gc_sections=yes
-+ fi
-+ else
-+ glibcxx_gcsections_min_ld=21602
-+ if test x"$with_gnu_ld" = x"yes" &&
-+ test $glibcxx_gnu_ld_version -gt $glibcxx_gcsections_min_ld ; then
-+ glibcxx_have_gc_sections=yes
-+ fi
-+ fi
-+ if test "$glibcxx_have_gc_sections" = "yes"; then
-+ # Sufficiently young GNU ld it is! Joy and bunny rabbits!
-+ # NB: This flag only works reliably after 2.16.1. Configure tests
-+ # for this are difficult, so hard wire a value that should work.
-+
-+ ac_test_CFLAGS="${CFLAGS+set}"
-+ ac_save_CFLAGS="$CFLAGS"
-+ CFLAGS='-Wl,--gc-sections'
-+
-+ # Check for -Wl,--gc-sections
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,--gc-sections" >&5
-+$as_echo_n "checking for ld that supports -Wl,--gc-sections... " >&6; }
-+ if test x$gcc_no_link = xyes; then
-+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
-+fi
-+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+ int one(void) { return 1; }
-+ int two(void) { return 2; }
-+
-+int
-+main ()
-+{
-+ two();
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_link "$LINENO"; then :
-+ ac_gcsections=yes
-+else
-+ ac_gcsections=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext \
-+ conftest$ac_exeext conftest.$ac_ext
-+ if test "$ac_gcsections" = "yes"; then
-+ rm -f conftest.c
-+ touch conftest.c
-+ if $CC -c conftest.c; then
-+ if $LD --gc-sections -o conftest conftest.o 2>&1 | \
-+ grep "Warning: gc-sections option ignored" > /dev/null; then
-+ ac_gcsections=no
-+ fi
-+ fi
-+ rm -f conftest.c conftest.o conftest
-+ fi
-+ if test "$ac_gcsections" = "yes"; then
-+ SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_gcsections" >&5
-+$as_echo "$ac_gcsections" >&6; }
-+
-+ if test "$ac_test_CFLAGS" = set; then
-+ CFLAGS="$ac_save_CFLAGS"
-+ else
-+ # this is the suspicious part
-+ CFLAGS=''
-+ fi
-+ fi
-+
-+ # Set -z,relro.
-+ # Note this is only for shared objects.
-+ ac_ld_relro=no
-+ if test x"$with_gnu_ld" = x"yes"; then
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,-z,relro" >&5
-+$as_echo_n "checking for ld that supports -Wl,-z,relro... " >&6; }
-+ cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"`
-+ if test -n "$cxx_z_relo"; then
-+ OPT_LDFLAGS="-Wl,-z,relro"
-+ ac_ld_relro=yes
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ld_relro" >&5
-+$as_echo "$ac_ld_relro" >&6; }
-+ fi
-+
-+ # Set linker optimization flags.
-+ if test x"$with_gnu_ld" = x"yes"; then
-+ OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
-+ fi
-+
-+
-+
-+
-+
-+ ac_test_CXXFLAGS="${CXXFLAGS+set}"
-+ ac_save_CXXFLAGS="$CXXFLAGS"
-+ CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5
-+$as_echo_n "checking for sin in -lm... " >&6; }
-+if test "${ac_cv_lib_m_sin+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+ ac_check_lib_save_LIBS=$LIBS
-+LIBS="-lm $LIBS"
-+if test x$gcc_no_link = xyes; then
-+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
-+fi
-+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+
-+/* Override any GCC internal prototype to avoid an error.
-+ Use char because int might match the return type of a GCC
-+ builtin and then its argument prototype would still apply. */
-+#ifdef __cplusplus
-+extern "C"
-+#endif
-+char sin ();
-+int
-+main ()
-+{
-+return sin ();
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_link "$LINENO"; then :
-+ ac_cv_lib_m_sin=yes
-+else
-+ ac_cv_lib_m_sin=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext \
-+ conftest$ac_exeext conftest.$ac_ext
-+LIBS=$ac_check_lib_save_LIBS
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5
-+$as_echo "$ac_cv_lib_m_sin" >&6; }
-+if test "x$ac_cv_lib_m_sin" = x""yes; then :
-+ libm="-lm"
-+fi
-+
-+ ac_save_LIBS="$LIBS"
-+ LIBS="$LIBS $libm"
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinf declaration" >&5
-+$as_echo_n "checking for isinf declaration... " >&6; }
-+ if test x${glibcxx_cv_func_isinf_use+set} != xset; then
-+ if test "${glibcxx_cv_func_isinf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ isinf(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_isinf_use=yes
-+else
-+ glibcxx_cv_func_isinf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_isinf_use" >&5
-+$as_echo "$glibcxx_cv_func_isinf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_isinf_use = x"yes"; then
-+ for ac_func in isinf
-+do :
-+ ac_fn_c_check_func "$LINENO" "isinf" "ac_cv_func_isinf"
-+if test "x$ac_cv_func_isinf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_ISINF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _isinf declaration" >&5
-+$as_echo_n "checking for _isinf declaration... " >&6; }
-+ if test x${glibcxx_cv_func__isinf_use+set} != xset; then
-+ if test "${glibcxx_cv_func__isinf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ _isinf(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__isinf_use=yes
-+else
-+ glibcxx_cv_func__isinf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__isinf_use" >&5
-+$as_echo "$glibcxx_cv_func__isinf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__isinf_use = x"yes"; then
-+ for ac_func in _isinf
-+do :
-+ ac_fn_c_check_func "$LINENO" "_isinf" "ac_cv_func__isinf"
-+if test "x$ac_cv_func__isinf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__ISINF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isnan declaration" >&5
-+$as_echo_n "checking for isnan declaration... " >&6; }
-+ if test x${glibcxx_cv_func_isnan_use+set} != xset; then
-+ if test "${glibcxx_cv_func_isnan_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ isnan(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_isnan_use=yes
-+else
-+ glibcxx_cv_func_isnan_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_isnan_use" >&5
-+$as_echo "$glibcxx_cv_func_isnan_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_isnan_use = x"yes"; then
-+ for ac_func in isnan
-+do :
-+ ac_fn_c_check_func "$LINENO" "isnan" "ac_cv_func_isnan"
-+if test "x$ac_cv_func_isnan" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_ISNAN 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _isnan declaration" >&5
-+$as_echo_n "checking for _isnan declaration... " >&6; }
-+ if test x${glibcxx_cv_func__isnan_use+set} != xset; then
-+ if test "${glibcxx_cv_func__isnan_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ _isnan(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__isnan_use=yes
-+else
-+ glibcxx_cv_func__isnan_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__isnan_use" >&5
-+$as_echo "$glibcxx_cv_func__isnan_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__isnan_use = x"yes"; then
-+ for ac_func in _isnan
-+do :
-+ ac_fn_c_check_func "$LINENO" "_isnan" "ac_cv_func__isnan"
-+if test "x$ac_cv_func__isnan" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__ISNAN 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for finite declaration" >&5
-+$as_echo_n "checking for finite declaration... " >&6; }
-+ if test x${glibcxx_cv_func_finite_use+set} != xset; then
-+ if test "${glibcxx_cv_func_finite_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ finite(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_finite_use=yes
-+else
-+ glibcxx_cv_func_finite_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_finite_use" >&5
-+$as_echo "$glibcxx_cv_func_finite_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_finite_use = x"yes"; then
-+ for ac_func in finite
-+do :
-+ ac_fn_c_check_func "$LINENO" "finite" "ac_cv_func_finite"
-+if test "x$ac_cv_func_finite" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_FINITE 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _finite declaration" >&5
-+$as_echo_n "checking for _finite declaration... " >&6; }
-+ if test x${glibcxx_cv_func__finite_use+set} != xset; then
-+ if test "${glibcxx_cv_func__finite_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ _finite(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__finite_use=yes
-+else
-+ glibcxx_cv_func__finite_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__finite_use" >&5
-+$as_echo "$glibcxx_cv_func__finite_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__finite_use = x"yes"; then
-+ for ac_func in _finite
-+do :
-+ ac_fn_c_check_func "$LINENO" "_finite" "ac_cv_func__finite"
-+if test "x$ac_cv_func__finite" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__FINITE 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sincos declaration" >&5
-+$as_echo_n "checking for sincos declaration... " >&6; }
-+ if test x${glibcxx_cv_func_sincos_use+set} != xset; then
-+ if test "${glibcxx_cv_func_sincos_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ sincos(0, 0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_sincos_use=yes
-+else
-+ glibcxx_cv_func_sincos_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_sincos_use" >&5
-+$as_echo "$glibcxx_cv_func_sincos_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_sincos_use = x"yes"; then
-+ for ac_func in sincos
-+do :
-+ ac_fn_c_check_func "$LINENO" "sincos" "ac_cv_func_sincos"
-+if test "x$ac_cv_func_sincos" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_SINCOS 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _sincos declaration" >&5
-+$as_echo_n "checking for _sincos declaration... " >&6; }
-+ if test x${glibcxx_cv_func__sincos_use+set} != xset; then
-+ if test "${glibcxx_cv_func__sincos_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ _sincos(0, 0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__sincos_use=yes
-+else
-+ glibcxx_cv_func__sincos_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__sincos_use" >&5
-+$as_echo "$glibcxx_cv_func__sincos_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__sincos_use = x"yes"; then
-+ for ac_func in _sincos
-+do :
-+ ac_fn_c_check_func "$LINENO" "_sincos" "ac_cv_func__sincos"
-+if test "x$ac_cv_func__sincos" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__SINCOS 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fpclass declaration" >&5
-+$as_echo_n "checking for fpclass declaration... " >&6; }
-+ if test x${glibcxx_cv_func_fpclass_use+set} != xset; then
-+ if test "${glibcxx_cv_func_fpclass_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ fpclass(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_fpclass_use=yes
-+else
-+ glibcxx_cv_func_fpclass_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_fpclass_use" >&5
-+$as_echo "$glibcxx_cv_func_fpclass_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_fpclass_use = x"yes"; then
-+ for ac_func in fpclass
-+do :
-+ ac_fn_c_check_func "$LINENO" "fpclass" "ac_cv_func_fpclass"
-+if test "x$ac_cv_func_fpclass" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_FPCLASS 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _fpclass declaration" >&5
-+$as_echo_n "checking for _fpclass declaration... " >&6; }
-+ if test x${glibcxx_cv_func__fpclass_use+set} != xset; then
-+ if test "${glibcxx_cv_func__fpclass_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ _fpclass(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__fpclass_use=yes
-+else
-+ glibcxx_cv_func__fpclass_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__fpclass_use" >&5
-+$as_echo "$glibcxx_cv_func__fpclass_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__fpclass_use = x"yes"; then
-+ for ac_func in _fpclass
-+do :
-+ ac_fn_c_check_func "$LINENO" "_fpclass" "ac_cv_func__fpclass"
-+if test "x$ac_cv_func__fpclass" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__FPCLASS 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for qfpclass declaration" >&5
-+$as_echo_n "checking for qfpclass declaration... " >&6; }
-+ if test x${glibcxx_cv_func_qfpclass_use+set} != xset; then
-+ if test "${glibcxx_cv_func_qfpclass_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ qfpclass(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_qfpclass_use=yes
-+else
-+ glibcxx_cv_func_qfpclass_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_qfpclass_use" >&5
-+$as_echo "$glibcxx_cv_func_qfpclass_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_qfpclass_use = x"yes"; then
-+ for ac_func in qfpclass
-+do :
-+ ac_fn_c_check_func "$LINENO" "qfpclass" "ac_cv_func_qfpclass"
-+if test "x$ac_cv_func_qfpclass" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_QFPCLASS 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _qfpclass declaration" >&5
-+$as_echo_n "checking for _qfpclass declaration... " >&6; }
-+ if test x${glibcxx_cv_func__qfpclass_use+set} != xset; then
-+ if test "${glibcxx_cv_func__qfpclass_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ _qfpclass(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__qfpclass_use=yes
-+else
-+ glibcxx_cv_func__qfpclass_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__qfpclass_use" >&5
-+$as_echo "$glibcxx_cv_func__qfpclass_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__qfpclass_use = x"yes"; then
-+ for ac_func in _qfpclass
-+do :
-+ ac_fn_c_check_func "$LINENO" "_qfpclass" "ac_cv_func__qfpclass"
-+if test "x$ac_cv_func__qfpclass" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__QFPCLASS 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hypot declaration" >&5
-+$as_echo_n "checking for hypot declaration... " >&6; }
-+ if test x${glibcxx_cv_func_hypot_use+set} != xset; then
-+ if test "${glibcxx_cv_func_hypot_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ hypot(0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_hypot_use=yes
-+else
-+ glibcxx_cv_func_hypot_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_hypot_use" >&5
-+$as_echo "$glibcxx_cv_func_hypot_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_hypot_use = x"yes"; then
-+ for ac_func in hypot
-+do :
-+ ac_fn_c_check_func "$LINENO" "hypot" "ac_cv_func_hypot"
-+if test "x$ac_cv_func_hypot" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_HYPOT 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _hypot declaration" >&5
-+$as_echo_n "checking for _hypot declaration... " >&6; }
-+ if test x${glibcxx_cv_func__hypot_use+set} != xset; then
-+ if test "${glibcxx_cv_func__hypot_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ _hypot(0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__hypot_use=yes
-+else
-+ glibcxx_cv_func__hypot_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__hypot_use" >&5
-+$as_echo "$glibcxx_cv_func__hypot_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__hypot_use = x"yes"; then
-+ for ac_func in _hypot
-+do :
-+ ac_fn_c_check_func "$LINENO" "_hypot" "ac_cv_func__hypot"
-+if test "x$ac_cv_func__hypot" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__HYPOT 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for float trig functions" >&5
-+$as_echo_n "checking for float trig functions... " >&6; }
-+ if test "${glibcxx_cv_func_float_trig_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+acosf (0); asinf (0); atanf (0); cosf (0); sinf (0); tanf (0); coshf (0); sinhf (0); tanhf (0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_float_trig_use=yes
-+else
-+ glibcxx_cv_func_float_trig_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+fi
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_float_trig_use" >&5
-+$as_echo "$glibcxx_cv_func_float_trig_use" >&6; }
-+ if test x$glibcxx_cv_func_float_trig_use = x"yes"; then
-+ for ac_func in acosf asinf atanf cosf sinf tanf coshf sinhf tanhf
-+do :
-+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-+eval as_val=\$$as_ac_var
-+ if test "x$as_val" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _float trig functions" >&5
-+$as_echo_n "checking for _float trig functions... " >&6; }
-+ if test "${glibcxx_cv_func__float_trig_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+_acosf (0); _asinf (0); _atanf (0); _cosf (0); _sinf (0); _tanf (0); _coshf (0); _sinhf (0); _tanhf (0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__float_trig_use=yes
-+else
-+ glibcxx_cv_func__float_trig_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+fi
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__float_trig_use" >&5
-+$as_echo "$glibcxx_cv_func__float_trig_use" >&6; }
-+ if test x$glibcxx_cv_func__float_trig_use = x"yes"; then
-+ for ac_func in _acosf _asinf _atanf _cosf _sinf _tanf _coshf _sinhf _tanhf
-+do :
-+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-+eval as_val=\$$as_ac_var
-+ if test "x$as_val" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for float round functions" >&5
-+$as_echo_n "checking for float round functions... " >&6; }
-+ if test "${glibcxx_cv_func_float_round_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ceilf (0); floorf (0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_float_round_use=yes
-+else
-+ glibcxx_cv_func_float_round_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+fi
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_float_round_use" >&5
-+$as_echo "$glibcxx_cv_func_float_round_use" >&6; }
-+ if test x$glibcxx_cv_func_float_round_use = x"yes"; then
-+ for ac_func in ceilf floorf
-+do :
-+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-+eval as_val=\$$as_ac_var
-+ if test "x$as_val" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _float round functions" >&5
-+$as_echo_n "checking for _float round functions... " >&6; }
-+ if test "${glibcxx_cv_func__float_round_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+_ceilf (0); _floorf (0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__float_round_use=yes
-+else
-+ glibcxx_cv_func__float_round_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+fi
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__float_round_use" >&5
-+$as_echo "$glibcxx_cv_func__float_round_use" >&6; }
-+ if test x$glibcxx_cv_func__float_round_use = x"yes"; then
-+ for ac_func in _ceilf _floorf
-+do :
-+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-+eval as_val=\$$as_ac_var
-+ if test "x$as_val" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for expf declaration" >&5
-+$as_echo_n "checking for expf declaration... " >&6; }
-+ if test x${glibcxx_cv_func_expf_use+set} != xset; then
-+ if test "${glibcxx_cv_func_expf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ expf(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_expf_use=yes
-+else
-+ glibcxx_cv_func_expf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_expf_use" >&5
-+$as_echo "$glibcxx_cv_func_expf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_expf_use = x"yes"; then
-+ for ac_func in expf
-+do :
-+ ac_fn_c_check_func "$LINENO" "expf" "ac_cv_func_expf"
-+if test "x$ac_cv_func_expf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_EXPF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _expf declaration" >&5
-+$as_echo_n "checking for _expf declaration... " >&6; }
-+ if test x${glibcxx_cv_func__expf_use+set} != xset; then
-+ if test "${glibcxx_cv_func__expf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ _expf(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__expf_use=yes
-+else
-+ glibcxx_cv_func__expf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__expf_use" >&5
-+$as_echo "$glibcxx_cv_func__expf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__expf_use = x"yes"; then
-+ for ac_func in _expf
-+do :
-+ ac_fn_c_check_func "$LINENO" "_expf" "ac_cv_func__expf"
-+if test "x$ac_cv_func__expf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__EXPF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isnanf declaration" >&5
-+$as_echo_n "checking for isnanf declaration... " >&6; }
-+ if test x${glibcxx_cv_func_isnanf_use+set} != xset; then
-+ if test "${glibcxx_cv_func_isnanf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ isnanf(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_isnanf_use=yes
-+else
-+ glibcxx_cv_func_isnanf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_isnanf_use" >&5
-+$as_echo "$glibcxx_cv_func_isnanf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_isnanf_use = x"yes"; then
-+ for ac_func in isnanf
-+do :
-+ ac_fn_c_check_func "$LINENO" "isnanf" "ac_cv_func_isnanf"
-+if test "x$ac_cv_func_isnanf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_ISNANF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _isnanf declaration" >&5
-+$as_echo_n "checking for _isnanf declaration... " >&6; }
-+ if test x${glibcxx_cv_func__isnanf_use+set} != xset; then
-+ if test "${glibcxx_cv_func__isnanf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ _isnanf(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__isnanf_use=yes
-+else
-+ glibcxx_cv_func__isnanf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__isnanf_use" >&5
-+$as_echo "$glibcxx_cv_func__isnanf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__isnanf_use = x"yes"; then
-+ for ac_func in _isnanf
-+do :
-+ ac_fn_c_check_func "$LINENO" "_isnanf" "ac_cv_func__isnanf"
-+if test "x$ac_cv_func__isnanf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__ISNANF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinff declaration" >&5
-+$as_echo_n "checking for isinff declaration... " >&6; }
-+ if test x${glibcxx_cv_func_isinff_use+set} != xset; then
-+ if test "${glibcxx_cv_func_isinff_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ isinff(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_isinff_use=yes
-+else
-+ glibcxx_cv_func_isinff_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_isinff_use" >&5
-+$as_echo "$glibcxx_cv_func_isinff_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_isinff_use = x"yes"; then
-+ for ac_func in isinff
-+do :
-+ ac_fn_c_check_func "$LINENO" "isinff" "ac_cv_func_isinff"
-+if test "x$ac_cv_func_isinff" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_ISINFF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _isinff declaration" >&5
-+$as_echo_n "checking for _isinff declaration... " >&6; }
-+ if test x${glibcxx_cv_func__isinff_use+set} != xset; then
-+ if test "${glibcxx_cv_func__isinff_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ _isinff(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__isinff_use=yes
-+else
-+ glibcxx_cv_func__isinff_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__isinff_use" >&5
-+$as_echo "$glibcxx_cv_func__isinff_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__isinff_use = x"yes"; then
-+ for ac_func in _isinff
-+do :
-+ ac_fn_c_check_func "$LINENO" "_isinff" "ac_cv_func__isinff"
-+if test "x$ac_cv_func__isinff" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__ISINFF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atan2f declaration" >&5
-+$as_echo_n "checking for atan2f declaration... " >&6; }
-+ if test x${glibcxx_cv_func_atan2f_use+set} != xset; then
-+ if test "${glibcxx_cv_func_atan2f_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ atan2f(0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_atan2f_use=yes
-+else
-+ glibcxx_cv_func_atan2f_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_atan2f_use" >&5
-+$as_echo "$glibcxx_cv_func_atan2f_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_atan2f_use = x"yes"; then
-+ for ac_func in atan2f
-+do :
-+ ac_fn_c_check_func "$LINENO" "atan2f" "ac_cv_func_atan2f"
-+if test "x$ac_cv_func_atan2f" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_ATAN2F 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _atan2f declaration" >&5
-+$as_echo_n "checking for _atan2f declaration... " >&6; }
-+ if test x${glibcxx_cv_func__atan2f_use+set} != xset; then
-+ if test "${glibcxx_cv_func__atan2f_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ _atan2f(0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__atan2f_use=yes
-+else
-+ glibcxx_cv_func__atan2f_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__atan2f_use" >&5
-+$as_echo "$glibcxx_cv_func__atan2f_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__atan2f_use = x"yes"; then
-+ for ac_func in _atan2f
-+do :
-+ ac_fn_c_check_func "$LINENO" "_atan2f" "ac_cv_func__atan2f"
-+if test "x$ac_cv_func__atan2f" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__ATAN2F 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fabsf declaration" >&5
-+$as_echo_n "checking for fabsf declaration... " >&6; }
-+ if test x${glibcxx_cv_func_fabsf_use+set} != xset; then
-+ if test "${glibcxx_cv_func_fabsf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ fabsf(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_fabsf_use=yes
-+else
-+ glibcxx_cv_func_fabsf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_fabsf_use" >&5
-+$as_echo "$glibcxx_cv_func_fabsf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_fabsf_use = x"yes"; then
-+ for ac_func in fabsf
-+do :
-+ ac_fn_c_check_func "$LINENO" "fabsf" "ac_cv_func_fabsf"
-+if test "x$ac_cv_func_fabsf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_FABSF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _fabsf declaration" >&5
-+$as_echo_n "checking for _fabsf declaration... " >&6; }
-+ if test x${glibcxx_cv_func__fabsf_use+set} != xset; then
-+ if test "${glibcxx_cv_func__fabsf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ _fabsf(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__fabsf_use=yes
-+else
-+ glibcxx_cv_func__fabsf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__fabsf_use" >&5
-+$as_echo "$glibcxx_cv_func__fabsf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__fabsf_use = x"yes"; then
-+ for ac_func in _fabsf
-+do :
-+ ac_fn_c_check_func "$LINENO" "_fabsf" "ac_cv_func__fabsf"
-+if test "x$ac_cv_func__fabsf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__FABSF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fmodf declaration" >&5
-+$as_echo_n "checking for fmodf declaration... " >&6; }
-+ if test x${glibcxx_cv_func_fmodf_use+set} != xset; then
-+ if test "${glibcxx_cv_func_fmodf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ fmodf(0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_fmodf_use=yes
-+else
-+ glibcxx_cv_func_fmodf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_fmodf_use" >&5
-+$as_echo "$glibcxx_cv_func_fmodf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_fmodf_use = x"yes"; then
-+ for ac_func in fmodf
-+do :
-+ ac_fn_c_check_func "$LINENO" "fmodf" "ac_cv_func_fmodf"
-+if test "x$ac_cv_func_fmodf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_FMODF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _fmodf declaration" >&5
-+$as_echo_n "checking for _fmodf declaration... " >&6; }
-+ if test x${glibcxx_cv_func__fmodf_use+set} != xset; then
-+ if test "${glibcxx_cv_func__fmodf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ _fmodf(0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__fmodf_use=yes
-+else
-+ glibcxx_cv_func__fmodf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__fmodf_use" >&5
-+$as_echo "$glibcxx_cv_func__fmodf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__fmodf_use = x"yes"; then
-+ for ac_func in _fmodf
-+do :
-+ ac_fn_c_check_func "$LINENO" "_fmodf" "ac_cv_func__fmodf"
-+if test "x$ac_cv_func__fmodf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__FMODF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for frexpf declaration" >&5
-+$as_echo_n "checking for frexpf declaration... " >&6; }
-+ if test x${glibcxx_cv_func_frexpf_use+set} != xset; then
-+ if test "${glibcxx_cv_func_frexpf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ frexpf(0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_frexpf_use=yes
-+else
-+ glibcxx_cv_func_frexpf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_frexpf_use" >&5
-+$as_echo "$glibcxx_cv_func_frexpf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_frexpf_use = x"yes"; then
-+ for ac_func in frexpf
-+do :
-+ ac_fn_c_check_func "$LINENO" "frexpf" "ac_cv_func_frexpf"
-+if test "x$ac_cv_func_frexpf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_FREXPF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _frexpf declaration" >&5
-+$as_echo_n "checking for _frexpf declaration... " >&6; }
-+ if test x${glibcxx_cv_func__frexpf_use+set} != xset; then
-+ if test "${glibcxx_cv_func__frexpf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ _frexpf(0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__frexpf_use=yes
-+else
-+ glibcxx_cv_func__frexpf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__frexpf_use" >&5
-+$as_echo "$glibcxx_cv_func__frexpf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__frexpf_use = x"yes"; then
-+ for ac_func in _frexpf
-+do :
-+ ac_fn_c_check_func "$LINENO" "_frexpf" "ac_cv_func__frexpf"
-+if test "x$ac_cv_func__frexpf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__FREXPF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hypotf declaration" >&5
-+$as_echo_n "checking for hypotf declaration... " >&6; }
-+ if test x${glibcxx_cv_func_hypotf_use+set} != xset; then
-+ if test "${glibcxx_cv_func_hypotf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ hypotf(0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_hypotf_use=yes
-+else
-+ glibcxx_cv_func_hypotf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_hypotf_use" >&5
-+$as_echo "$glibcxx_cv_func_hypotf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_hypotf_use = x"yes"; then
-+ for ac_func in hypotf
-+do :
-+ ac_fn_c_check_func "$LINENO" "hypotf" "ac_cv_func_hypotf"
-+if test "x$ac_cv_func_hypotf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_HYPOTF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _hypotf declaration" >&5
-+$as_echo_n "checking for _hypotf declaration... " >&6; }
-+ if test x${glibcxx_cv_func__hypotf_use+set} != xset; then
-+ if test "${glibcxx_cv_func__hypotf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ _hypotf(0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__hypotf_use=yes
-+else
-+ glibcxx_cv_func__hypotf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__hypotf_use" >&5
-+$as_echo "$glibcxx_cv_func__hypotf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__hypotf_use = x"yes"; then
-+ for ac_func in _hypotf
-+do :
-+ ac_fn_c_check_func "$LINENO" "_hypotf" "ac_cv_func__hypotf"
-+if test "x$ac_cv_func__hypotf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__HYPOTF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldexpf declaration" >&5
-+$as_echo_n "checking for ldexpf declaration... " >&6; }
-+ if test x${glibcxx_cv_func_ldexpf_use+set} != xset; then
-+ if test "${glibcxx_cv_func_ldexpf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ ldexpf(0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_ldexpf_use=yes
-+else
-+ glibcxx_cv_func_ldexpf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_ldexpf_use" >&5
-+$as_echo "$glibcxx_cv_func_ldexpf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_ldexpf_use = x"yes"; then
-+ for ac_func in ldexpf
-+do :
-+ ac_fn_c_check_func "$LINENO" "ldexpf" "ac_cv_func_ldexpf"
-+if test "x$ac_cv_func_ldexpf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_LDEXPF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _ldexpf declaration" >&5
-+$as_echo_n "checking for _ldexpf declaration... " >&6; }
-+ if test x${glibcxx_cv_func__ldexpf_use+set} != xset; then
-+ if test "${glibcxx_cv_func__ldexpf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ _ldexpf(0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__ldexpf_use=yes
-+else
-+ glibcxx_cv_func__ldexpf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__ldexpf_use" >&5
-+$as_echo "$glibcxx_cv_func__ldexpf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__ldexpf_use = x"yes"; then
-+ for ac_func in _ldexpf
-+do :
-+ ac_fn_c_check_func "$LINENO" "_ldexpf" "ac_cv_func__ldexpf"
-+if test "x$ac_cv_func__ldexpf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__LDEXPF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for logf declaration" >&5
-+$as_echo_n "checking for logf declaration... " >&6; }
-+ if test x${glibcxx_cv_func_logf_use+set} != xset; then
-+ if test "${glibcxx_cv_func_logf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ logf(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_logf_use=yes
-+else
-+ glibcxx_cv_func_logf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_logf_use" >&5
-+$as_echo "$glibcxx_cv_func_logf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_logf_use = x"yes"; then
-+ for ac_func in logf
-+do :
-+ ac_fn_c_check_func "$LINENO" "logf" "ac_cv_func_logf"
-+if test "x$ac_cv_func_logf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_LOGF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _logf declaration" >&5
-+$as_echo_n "checking for _logf declaration... " >&6; }
-+ if test x${glibcxx_cv_func__logf_use+set} != xset; then
-+ if test "${glibcxx_cv_func__logf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ _logf(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__logf_use=yes
-+else
-+ glibcxx_cv_func__logf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__logf_use" >&5
-+$as_echo "$glibcxx_cv_func__logf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__logf_use = x"yes"; then
-+ for ac_func in _logf
-+do :
-+ ac_fn_c_check_func "$LINENO" "_logf" "ac_cv_func__logf"
-+if test "x$ac_cv_func__logf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__LOGF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log10f declaration" >&5
-+$as_echo_n "checking for log10f declaration... " >&6; }
-+ if test x${glibcxx_cv_func_log10f_use+set} != xset; then
-+ if test "${glibcxx_cv_func_log10f_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ log10f(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_log10f_use=yes
-+else
-+ glibcxx_cv_func_log10f_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_log10f_use" >&5
-+$as_echo "$glibcxx_cv_func_log10f_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_log10f_use = x"yes"; then
-+ for ac_func in log10f
-+do :
-+ ac_fn_c_check_func "$LINENO" "log10f" "ac_cv_func_log10f"
-+if test "x$ac_cv_func_log10f" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_LOG10F 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _log10f declaration" >&5
-+$as_echo_n "checking for _log10f declaration... " >&6; }
-+ if test x${glibcxx_cv_func__log10f_use+set} != xset; then
-+ if test "${glibcxx_cv_func__log10f_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ _log10f(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__log10f_use=yes
-+else
-+ glibcxx_cv_func__log10f_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__log10f_use" >&5
-+$as_echo "$glibcxx_cv_func__log10f_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__log10f_use = x"yes"; then
-+ for ac_func in _log10f
-+do :
-+ ac_fn_c_check_func "$LINENO" "_log10f" "ac_cv_func__log10f"
-+if test "x$ac_cv_func__log10f" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__LOG10F 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for modff declaration" >&5
-+$as_echo_n "checking for modff declaration... " >&6; }
-+ if test x${glibcxx_cv_func_modff_use+set} != xset; then
-+ if test "${glibcxx_cv_func_modff_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ modff(0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_modff_use=yes
-+else
-+ glibcxx_cv_func_modff_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_modff_use" >&5
-+$as_echo "$glibcxx_cv_func_modff_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_modff_use = x"yes"; then
-+ for ac_func in modff
-+do :
-+ ac_fn_c_check_func "$LINENO" "modff" "ac_cv_func_modff"
-+if test "x$ac_cv_func_modff" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_MODFF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _modff declaration" >&5
-+$as_echo_n "checking for _modff declaration... " >&6; }
-+ if test x${glibcxx_cv_func__modff_use+set} != xset; then
-+ if test "${glibcxx_cv_func__modff_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ _modff(0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__modff_use=yes
-+else
-+ glibcxx_cv_func__modff_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__modff_use" >&5
-+$as_echo "$glibcxx_cv_func__modff_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__modff_use = x"yes"; then
-+ for ac_func in _modff
-+do :
-+ ac_fn_c_check_func "$LINENO" "_modff" "ac_cv_func__modff"
-+if test "x$ac_cv_func__modff" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__MODFF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for modf declaration" >&5
-+$as_echo_n "checking for modf declaration... " >&6; }
-+ if test x${glibcxx_cv_func_modf_use+set} != xset; then
-+ if test "${glibcxx_cv_func_modf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ modf(0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_modf_use=yes
-+else
-+ glibcxx_cv_func_modf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_modf_use" >&5
-+$as_echo "$glibcxx_cv_func_modf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_modf_use = x"yes"; then
-+ for ac_func in modf
-+do :
-+ ac_fn_c_check_func "$LINENO" "modf" "ac_cv_func_modf"
-+if test "x$ac_cv_func_modf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_MODF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _modf declaration" >&5
-+$as_echo_n "checking for _modf declaration... " >&6; }
-+ if test x${glibcxx_cv_func__modf_use+set} != xset; then
-+ if test "${glibcxx_cv_func__modf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ _modf(0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__modf_use=yes
-+else
-+ glibcxx_cv_func__modf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__modf_use" >&5
-+$as_echo "$glibcxx_cv_func__modf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__modf_use = x"yes"; then
-+ for ac_func in _modf
-+do :
-+ ac_fn_c_check_func "$LINENO" "_modf" "ac_cv_func__modf"
-+if test "x$ac_cv_func__modf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__MODF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for powf declaration" >&5
-+$as_echo_n "checking for powf declaration... " >&6; }
-+ if test x${glibcxx_cv_func_powf_use+set} != xset; then
-+ if test "${glibcxx_cv_func_powf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ powf(0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_powf_use=yes
-+else
-+ glibcxx_cv_func_powf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_powf_use" >&5
-+$as_echo "$glibcxx_cv_func_powf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_powf_use = x"yes"; then
-+ for ac_func in powf
-+do :
-+ ac_fn_c_check_func "$LINENO" "powf" "ac_cv_func_powf"
-+if test "x$ac_cv_func_powf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_POWF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ else
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _powf declaration" >&5
-+$as_echo_n "checking for _powf declaration... " >&6; }
-+ if test x${glibcxx_cv_func__powf_use+set} != xset; then
-+ if test "${glibcxx_cv_func__powf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+int
-+main ()
-+{
-+ _powf(0, 0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func__powf_use=yes
-+else
-+ glibcxx_cv_func__powf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func__powf_use" >&5
-+$as_echo "$glibcxx_cv_func__powf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func__powf_use = x"yes"; then
-+ for ac_func in _powf
-+do :
-+ ac_fn_c_check_func "$LINENO" "_powf" "ac_cv_func__powf"
-+if test "x$ac_cv_func__powf" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE__POWF 1
-+_ACEOF
-+
-+fi
-+done
-+
-+ fi
-+ fi
-+
-+
-+
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrtf declaration" >&5
-+$as_echo_n "checking for sqrtf declaration... " >&6; }
-+ if test x${glibcxx_cv_func_sqrtf_use+set} != xset; then
-+ if test "${glibcxx_cv_func_sqrtf_use+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+
-+
-+ ac_ext=cpp
-+ac_cpp='$CXXCPP $CPPFLAGS'
-+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-+
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <math.h>
-+ #ifdef HAVE_IEEEFP_H
-+ #include <ieeefp.h>
-+ #endif
-+
-+int
-+main ()
-+{
-+ sqrtf(0);
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_cxx_try_compile "$LINENO"; then :
-+ glibcxx_cv_func_sqrtf_use=yes
-+else
-+ glibcxx_cv_func_sqrtf_use=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+
-+
-+fi
-+
-+ fi
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_sqrtf_use" >&5
-+$as_echo "$glibcxx_cv_func_sqrtf_use" >&6; }
-+
-+ if test x$glibcxx_cv_func_sqrtf_use = x"yes"; then
-+ for ac_func in sqrtf
-+do :
-+ ac_fn_c_check_func "$LINENO" "sqrtf" "ac_cv_func_sqrtf"
-+if test "x$ac_cv_func_sqrtf" =