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: [PATCH 1/2] MIPS: Compressed PLT/stubs support


On Thu, Feb 21, 2013 at 02:06:34PM -0700, Tom Tromey wrote:
> Maciej>  	      if (type != ST_SYNTHETIC)
> Maciej>  		elf_sym = (elf_symbol_type *) sym;
> Maciej> -	      else
> Maciej> +	      else if (((sym->udata.i | 0xff) ^ 0xff) != 0)
> Maciej>  		elf_sym = (elf_symbol_type *) sym->udata.p;
> Maciej> +	      else
> Maciej> +		elf_sym = NULL;
> 
> This seems iffy to me.  I suppose what gives me pause is the possibility
> that this condition will trigger on some other port that does something
> odd in BFD.

ppc64 is the only target that currently provides get_synthetic_symtab
returning non-NULL values of udata.

We have

  union
    {
      void *p;
      bfd_vma i;
    }
  udata;

"i" is always 64 bits when ppc64 is supported by BFD.  The size of "p"
depends on the host.  If they happen to both be 64-bit the analysis is
easy and Maciej's change will break ppc64 if "p" can have an address
in the range [0,255].  For 32-bit little-endian hosts we get the same
result.  For 32-bit big-endian hosts, "p" occupies the high 32 bits of
"i", so any non-NULL value of "p" will pass the new test.

I doubt we care about hosts that might allocate memory from the zero
page, so Maciej's change is OK as far as I'm concerned.

Hmm, perhaps a cleaner change would be implement make_msymbol_special
for ppc64 and move the udata.p special case out of elf_symtab_read?

-- 
Alan Modra
Australia Development Lab, IBM


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