[PATCH] Create ".dynamic" section earlier

Daniel Jacobowitz drow@false.org
Fri Jun 9 19:16:00 GMT 2006


On Fri, Jun 09, 2006 at 11:40:09AM -0400, Fred Fish wrote:
> $ mips-elf-gcc -shared -o main main.c -Tidt.ld
> /links/opt-local/latest/trunk/bin/../lib/gcc/mips-elf/4.2.0/../../../../mips-elf/bin/ld: main: The first section in the PT_DYNAMIC segment is not the .dynamic section
> /links/opt-local/latest/trunk/bin/../lib/gcc/mips-elf/4.2.0/../../../../mips-elf/bin/ld: final link failed: Bad value
> collect2: ld returned 1 exit status

This problem, of course, only arises because the .dynamic section is
not in your linker script.  If you were using the standard linker
scripts generated by the ld build process, it would probably work.

The problem is that the parameter file for mips-elf has
GENERATE_SHLIB_SCRIPT=yes, so -shared is allowed by the linker, but
you're using a handwritten (from libgloss) linker script that doesn't. 
So orphan placement is kicking in.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Binutils mailing list