This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Spurious misguided message from GNU gold for missing symbol under 64-bit?
- From: Cary Coutant <ccoutant at google dot com>
- To: "ISHIKAWA,chiaki" <ishikawa at yk dot rim dot or dot jp>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Wed, 18 Jun 2014 14:09:45 -0700
- Subject: Re: Spurious misguided message from GNU gold for missing symbol under 64-bit?
- Authentication-results: sourceware.org; auth=none
- References: <53A0A624 dot 10506 at fgznet dot ch> <53A1673D dot 1010608 at arm dot com> <53A19F9C dot 5060905 at yk dot rim dot or dot jp>
> Can GNU Gold that is compiled and used under 64-bit
> produce a spurious misguided error message instead of simply reporting that
> a symbol is undefined and missing?
I think the "requires dynamic reloc" message is probably not spurious
or misleading, and probably does point to some problem in the build
process. Without any object files to look at, the best I can tell you
is that you'll get this message for an R_X86_64_PC32 relocation under
one of the following conditions:
(1) You're linking with -shared, but did not compile with -fpic.
(2) You're linking an executable, but the symbol is defined in a
shared library, and you've disabled copy relocations (-z nocopyreloc).
(There may be other possibilities, but they seem unlikely at the moment.)
It does later print an undefined reference error message, so that
should rule out the second condition.
What's the complete set of linker flags? Can you at least provide a
copy of MediaDecoderReader.o?
> After scratching my head many times, I tried the
> compilation and linking under 32-bit Debian GNU/Linux. Then I found
> that GNU gold there complained SIMPLY that the symbol in question is
> "undefined".
When linking for the 32-bit ABI, gold does not print the warning about
a dynamic relocation because (a) dynamic relocations in the text
segment are allowed in 32-bit mode, and (b) a 32-bit pc-relative
relocation can reach the entire address space.
-cary