This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH 1/2] MIPS: Compressed PLT/stubs support
- From: Alan Modra <amodra at gmail dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: "Maciej W. Rozycki" <macro at codesourcery dot com>, Richard Sandiford <rdsandiford at googlemail dot com>, Catherine Moore <clm at codesourcery dot com>, binutils at sourceware dot org, gdb-patches at sourceware dot org
- Date: Fri, 22 Feb 2013 11:28:33 +1030
- Subject: Re: [PATCH 1/2] MIPS: Compressed PLT/stubs support
- References: <alpine.DEB.firstname.lastname@example.org> <email@example.com>
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.
"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?
Australia Development Lab, IBM