Subject: ld changed behaviour recently ?
To: tech-toolchain@netbsd.org <tech-toolchain@netbsd.org>
From: Cherry G. Mathew <cherry.g.mathew@gmail.com>
List: tech-toolchain
Date: 04/03/2006 19:54:49
Hi,

Is there anything that prevents "sorted" and "normal" sections from
being linked together in a linker script in the .data section via a
linker script  ?

This cropped up between Dec. 05 and Today:

#      link  ski/skiload
/home/cherry/builds/tools/bin/ia64--netbsd-gcc -Wl,-nostdlib=20
-Wl,-T/mnt/ufs/sources/netbsd-cvs/src/sys/arch/ia64/stand/ia64/ski/ldscript=
.ia64
-symbolic -nostdlib   -o skiload=20
-Wl,-rpath-link,/home/cherry/builds/obj/destdir.ia64/lib:/home/cherry/build=
s/obj/destdir.ia64/usr/lib
 -L/home/cherry/builds/obj/destdir.ia64/lib=20
-B/home/cherry/builds/obj/destdir.ia64/usr/lib/
-B/home/cherry/builds/obj/destdir.ia64/usr/lib/   conf.o copy.o
delay.o devicename.o efi_stub.o exit.o main.o skiconsole.o pal_stub.o
sal_stub.o skifs.o ssc.o start.o time.o vers.o acpi_stub.o bootinfo.o
exec.o commands.o console.o devopen.o interp.o boot.o bcache.o
interp_backslash.o interp_parse.o ls.o misc.o panic.o calloc.o
readdir.o pager.o environment.o fileload.o getopt.o gets.o strdup.o
strtol.o strspn.o load_elf64.o
/mnt/ufs/sources/netbsd-cvs/src/sys/arch/ia64/stand/ia64/ski/lib/kern/libke=
rn.a
/mnt/ufs/sources/netbsd-cvs/src/sys/arch/ia64/stand/ia64/ski/lib/sa/libsa.a
/mnt/ufs/sources/netbsd-cvs/src/sys/arch/ia64/stand/ia64/ski/lib/z/libz.a
/mnt/ufs/sources/netbsd-cvs/src/sys/arch/ia64/stand/ia64/ski/lib/kern/libke=
rn.a
/mnt/ufs/sources/netbsd-cvs/src/sys/arch/ia64/stand/ia64/ski/lib/kern/libke=
rn.a
/mnt/ufs/sources/netbsd-cvs/src/sys/arch/ia64/stand/ia64/ski/lib/sa/libsa.a
/mnt/ufs/sources/netbsd-cvs/src/sys/arch/ia64/stand/ia64/ski/lib/z/libz.a
/mnt/ufs/sources/netbsd-cvs/src/sys/arch/ia64/stand/ia64/ski/lib/kern/libke=
rn.a
  -L/home/cherry/builds/obj/destdir.ia64/usr/lib
-L/home/cherry/builds/obj/destdir.ia64/usr/lib
/home/cherry/builds/tools/lib/gcc-lib/ia64--netbsd/3.3.3/../../../../ia64--=
netbsd/bin/ld:
.data has both ordered and unordered sections
/home/cherry/builds/tools/lib/gcc-lib/ia64--netbsd/3.3.3/../../../../ia64--=
netbsd/bin/ld:
final link failed: Bad value
collect2: ld returned 1 exit status


with the following addition to my link script:

--- ldscript.ia64.withunwind=092006-04-03 19:51:25.000000000 +0530
+++ ldscript.ia64=092006-04-03 19:53:03.000000000 +0530
@@ -18,8 +18,8 @@
     *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
     *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
     *(.opd)
-    *(.IA_64.unwind_info* .gnu.linkonce.ia64unwi.*) /*XXX: Fixme*/
-    *(.IA_64.unwind* .gnu.linkonce.ia64unw.*) /*XXX: Fixme*/
+    *(.IA_64.unwind_info* .gnu.linkonce.ia64unwi.*)
+    *(.IA_64.unwind* .gnu.linkonce.ia64unw.*)
     *(.data .data.* .gnu.linkonce.d.*)
     *(.data1)
     *(.plabel)

Thanks,

--
~Cherry