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: gold patch committed: Discard R_xxx_NONE relocations with -r


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


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