This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: RFC: PATCH: PR x86_64/584: Detect call on protected symbol
On Thu, Jan 20, 2005 at 02:52:34PM +1030, Alan Modra wrote:
> On Wed, Jan 19, 2005 at 07:17:09PM -0800, H. J. Lu wrote:
> > On Thu, Jan 20, 2005 at 12:25:19PM +1030, Alan Modra wrote:
> > > On Wed, Jan 19, 2005 at 04:40:32PM -0800, H. J. Lu wrote:
> > > > 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
> >
> > We can check if the input section is executable. The worst case is that
> > you may get a runtime error instead of a linktime one.
> >
> > > the possible load/store insns might have a sib byte of 0xE8.
> >
> > I think 0xe8 SIB is [RAX + RIP * 8], which can't have R_X86_64_PC32.
>
> Ah, no disp field. A modrm of 0xE8 won't have the PC32 reloc either.
> So the only problem is when people put things like jump tables in .text.
I don't think jump table uses R_X86_64_PC32. Does R_X86_64_PC32
only come from "branch label" or "insn label(%rip),xxx"? I don't
think we should worry about anything, like wrong insn, r_offset == 0,
jump table or data section.
H.J.