This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ld --relax and PC relative short jumps.
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Sanjiv Gupta <skg at cradle dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Sat, 22 Nov 2003 20:22:43 +1030
- Subject: Re: ld --relax and PC relative short jumps.
- References: <CPEBIFIFLKPINAADLBJHIEHMCIAA.skg@cradle.com>
On Sat, Nov 22, 2003 at 03:00:04PM +0530, Sanjiv Gupta wrote:
> How can I adjust PC relative jump offsets when the relaxation
> deletes code between the jump and its target? I have no
> relocs emitted for these short jumps :(
Make sure you do emit relocs. It's the only safe way for the linker to
determine what is a jump. What happens if someone writes some asm to
put a table into .text and some random data byte happens to look like a
jump?
--
Alan Modra
IBM OzLabs - Linux Technology Centre