RFC: PATCH: PR x86_64/584: Detect call on protected symbol

Alan Modra amodra@bigpond.net.au
Thu Jan 20 01:55:00 GMT 2005


On Wed, Jan 19, 2005 at 04:40:32PM -0800, H. J. Lu wrote:
> On Thu, Jan 20, 2005 at 12:05:44AM +0100, Jakub Jelinek wrote:
> > On Wed, Jan 19, 2005 at 02:48:34PM -0800, H. J. Lu wrote:
> > > X86_64 uses R_X86_64_PC32 for both branch and store/load. Linker
> > > can't tell if a protected symbol reference is local or global just
> > > by relocation. This patch disassembles the code to check for call.
> > 
> > Eh, why you need the disassembler there?
> > Isn't it enough just to check if R_X86_64_PC32's r_offset > 0 and
> > contents[r_offset - 1] == 0xe8?
> 
> Can we be sure that contents[r_offset - 1] == 0xe8 will be call?

Not if the PC32 reloc happens to be in data.  Also, I suspect some of
the possible load/store insns might have a sib byte of 0xE8.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list