Bug 1042

Summary: arch/ppc64/kernel/vdso32/vdso32.so: The first section in the PT_DYNAMIC segment is not the .dynamic section
Product: binutils Reporter: Olaf Hering <olh>
Component: ldAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: bug-binutils
Priority: P2    
Version: 2.17   
Target Milestone: ---   
Host: powerpc-linux Target: powerpc-linux
Build: powerpc-linux Last reconfirmed:
Attachments: binutils-bug1042.tar.bz2

Description Olaf Hering 2005-07-02 18:22:53 UTC
binutils mainline TZ=UTC 20050609 02:00 co works,
20050609 03:00 fails:

~/inst-20050609-0300/bin/ld --eh-frame-hdr -V -Qy -shared -m elf32ppclinux -o arch/ppc64/kernel/vdso32/vdso32.so -s -L/usr/lib/gcc/powerpc64-suse-linux/4.0.1/nof -L/usr/lib/gcc/powerpc64-suse-linux/4.0.1 -L/usr/lib/gcc/powerpc64-suse-linux/4.0.1/nof -L/usr/lib/gcc/powerpc64-suse-linux/4.0.1 -L/usr/lib/gcc/powerpc64-suse-linux/4.0.1/../../../../lib/nof -L/usr/lib/gcc/powerpc64-suse-linux/4.0.1/../../.. -L/lib/../lib/nof -L/usr/lib/../lib/nof -soname=linux-vdso32.so.1 -T arch/ppc64/kernel/vdso32/vdso32.lds arch/ppc64/kernel/vdso32/sigtramp.o arch/ppc64/kernel/vdso32/gettimeofday.o arch/ppc64/kernel/vdso32/datapage.o arch/ppc64/kernel/vdso32/cacheflush.o arch/ppc64/kernel/vdso32/note.o
GNU ld version 2.16.91 20050609
  Supported emulations:
   elf32ppclinux
   elf32ppc
   elf32ppcsim
   elf64alpha
   alpha
   hppalinux
   elf_i386
   i386linux
   elf64_ia64
   m68kelf
   m68klinux
   elf64ppc
   elf_s390
   elf64_s390
   elf32_sparc
   sparclinux
   elf64_sparc
   sun4
   elf_x86_64
   ppcmacos
/home/abuild/inst-20050609-0300/bin/ld: arch/ppc64/kernel/vdso32/vdso32.so: The first section in the PT_DYNAMIC segment is not the .dynamic section
/home/abuild/inst-20050609-0300/bin/ld: final link failed: Bad value
Comment 1 Olaf Hering 2005-07-02 18:29:04 UTC
Created attachment 533 [details]
binutils-bug1042.tar.bz2

sh test.sh
Comment 2 Alan Modra 2005-07-04 10:32:59 UTC
This is a result of vdso32.lds not specifying where to place .plt, and ld
ignoring the fact that .plt will be stripped from the output.  One fix is to
specify .plt as follows.

--- vdso32.lds~	2005-07-03 00:36:32.000000000 +0930
+++ vdso32.lds	2005-07-04 16:54:27.381552010 +0930
@@ -45,8 +45,9 @@
   .eh_frame : { KEEP (*(.eh_frame)) } :text
   .gcc_except_table : { *(.gcc_except_table) }
   .fixup : { *(.fixup) }
-  .got ALIGN(4) : { *(.got.plt) *(.got) }
   .dynamic : { *(.dynamic) } :text :dynamic
+  .got : { *(.got) }
+  .plt : { *(.plt) }
   _end = .;
   __end = .;
   PROVIDE (end = .);

I've also committing a linker fix.
http://sources.redhat.com/ml/binutils-cvs/2005-07/msg00016.html