This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: gold patch committed: Discard R_xxx_NONE relocations with -r
- From: Daniel Jacobowitz <drow at false dot org>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: binutils at sourceware dot org
- Date: Thu, 11 Dec 2008 21:51:31 -0500
- Subject: Re: gold patch committed: Discard R_xxx_NONE relocations with -r
- References: <m3abb2jepv.fsf@google.com>
On Thu, Dec 11, 2008 at 06:43:08PM -0800, Ian Lance Taylor wrote:
> @@ -342,8 +352,14 @@ class Default_scan_relocatable_relocs
> // Return the strategy to use for a global symbol, given the
> // relocation type, the object, and the symbol index.
> inline Relocatable_relocs::Reloc_strategy
> - global_strategy(unsigned int, Relobj*, unsigned int)
> - { return Relocatable_relocs::RELOC_COPY; }
> + global_strategy(unsigned int r_type, Relobj*, unsigned int)
> + {
> + // We assume that relocation type 0 is NONE. Targets which are
> + // different must override.
> + if (r_type == 0)
> + return Relocatable_relocs::RELOC_DISCARD;
> + return Relocatable_relocs::RELOC_COPY;
> + }
> };
>
> // Scan relocs during a relocatable link. This is a default
Am I reading correctly that you will discard R_xxx_NONE against an
undefined global symbol with ld -r? If so, that's a problem; some
other toolchains, and the ARM EABI, specify that NONE relocations are
valid for dependency marking. For instance, a file which passes a
printf format string including floating-point specifiers might include
a NONE relocation indicating that the floating-point-aware version of
printf is required.
--
Daniel Jacobowitz
CodeSourcery