Is there a way to detect a null reference function pointer during assembly or linking ?
William Tambe
tambewilliam@gmail.com
Sat Nov 30 02:23:00 GMT 2019
Is there a way to detect a null reference function pointer during
assembly or linking ?
In fact, the target to which I ported Binutils always generate
position-independent-code; so it is not always loaded at the address
specified in the ELF header, and that is where I run into issues; the
value of a null reference function pointer is not null when the
executable is not loaded at the address specified in the ELF header,
because that value is computed by offsetting a constant value from the
start of the section .text.
I would like to be able to detect a null reference function pointer,
and generate an instruction that load a null immediate value instead
of computing the null reference function pointer value by offsetting a
constant value.
Any pointers would be much appreciated.
More information about the Binutils
mailing list