This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Is there a way to detect a null reference function pointer during assembly or linking ?
- From: William Tambe <tambewilliam at gmail dot com>
- To: binutils at sourceware dot org
- Date: Fri, 29 Nov 2019 21:23:42 -0500
- Subject: Is there a way to detect a null reference function pointer during assembly or linking ?
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.