bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/17712] Invalid relocation record for pe-x86-64 absolute address


From: m at rolle dot name
Subject: [Bug gas/17712] Invalid relocation record for pe-x86-64 absolute addresses.
Date: Mon, 15 Dec 2014 18:36:04 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=17712

--- Comment #2 from Michael Rolle <m at rolle dot name> ---
Actually, a jump to an absolute 64-bit address using a 32-bit displacement
isn't possible anyway, no matter what the linker or loader tries to do.

So I think this instruction should be illegal in all cases.

The purpose of the PCREL32 relocation is to provide an RIP-relative 32-bit
offset to a target that will be in the same segment of the linked image file,
and the resulting offset must fit into a signed 32-bit value.  The loader can
put the entire image segment at any memory virtual address it desires, and this
does not affect any relative offsets within that segment.

Addresses to other image segments (in the same image, or in a dynamic library)
can be relocated by the loader with relocation records in the image.  These,
however, are full 64 bits.

In order to jump/call to an absolute address, the program has to either (1) get
the address in a register (a 64-bit 'MOV reg, offset' could be used) and do a
jump/call to the register, or (2) have the address in memory somewhere and do
an indirect jump/call to this memory location.  In either case, the opcode will
be FF /4 (jump) or FF /2 (call), rather than the E8 or E9 that gas is currently
assembling.

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]