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

See the CrossGCC FAQ for lots more information.


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: Gcc 4.1.2 `.rela.dyn' problem for powerpc-elf target


Sardaukar wrote:

> The build had no errors. Then I installed the toolchain and after that I
> tried to use it with a code group I have. All the compilations for the
> individual C files are OK but the linker gave the error:
> 
> The command is
> powerpc-elf-gcc --nostartfiles -g -static -Tlinkcmds -o bin/sdram-test.elf
> bin/sdram-test.o  ../lib/crt0.o -lbsp -lc -lnosys -static
> 
> and the error is:
> "powerpc-elf/bin/ld: error: no memory region specified for loadable section
> `.rela.dyn' "
> 
> Is it related to the configuration flags? I googled the error and found out
> that it is because of dynamic linking and a "shared library" problem. How
> can I compile the toolchain as "static"? Isn't the " --disable-shared" flag
> enough for it?

I don't know the answer to your question but here's how I'd debug it:
run the above gcc command with -###.  This will give you the subprocess
commands that it would invoke, which should give you the ld command
line.  (It might invoke collect2 in place of ld, but I think you can
just call ld with the same args.)  Then run that ld command by hand, but
add --verbose.  This will tell you everything that the linker is doing,
including which objects it's putting in the link.  Then go through that
list of objects and use objdump -h to see which one contains the
.rela.dyn section, which will tell you which component needs to be
fixed/rebuilt.  Or, it could be that the reference to that section is
coming only from something in the linker script, in which case you'd
need to just modify it to not try to place that section in the output.

Again, I don't know if this will give you the answer, but it's at least
a way to get closer to the reason.

Brian

--
For unsubscribe information see http://sourceware.org/lists.html#faq


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