This is the mail archive of the binutils@sources.redhat.com 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]

Re: new gas cannot grok new gcc output


On Wed, Feb 14, 2001 at 11:03:57PM -0800, Michael Sokolov wrote:
> target is an externally visible symbol. This happens when the
> TC_RELOC_RTSYM_LOC_FIXUP macro returns false. This macro is defined in
> gas/config/tc-m68k.h for ELF only as:
> 
> /* This expression evaluates to false if the relocation is for a local object
>    for which we still want to do the relocation at runtime.  True if we
>    are willing to perform this relocation while building the .o file.  If
>    the reloc is against an externally visible symbol, then the assembler
>    should never do the relocation.  */
> 
> #define TC_RELOC_RTSYM_LOC_FIXUP(FIX)			\
> 	((FIX)->fx_addsy == NULL			\
> 	 || (! S_IS_EXTERNAL ((FIX)->fx_addsy)		\
> 	     && ! S_IS_WEAK ((FIX)->fx_addsy)		\
> 	     && S_IS_DEFINED ((FIX)->fx_addsy)		\
> 	     && ! S_IS_COMMON ((FIX)->fx_addsy)))
> 
> It has been this way ever since the import of binutils into sourceware (not
> being a Red Hatter I can't trace it past this point in the real Cygnus tree).
> 
> I do not understand the reason behind this definition, and it seems bogus to
> me. m68k gas has always emitted object files with all internal references
> completely resolved like all traditional assemblers, it has never emitted
> relocs for internal references, even if they refer to externally visible
> symbols. This has never been any different for ELF from COFF or a.out. So if

For ELF, an externally visible symbol can be overriden if it is defined
in a shared library. Otherwise, things won't work right. That is why
the relocation has to be there.

BTW, there are tests in ld ld/testsuite/ld-elfvsb to test it.


H.J.


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