This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Create ".dynamic" section earlier


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]