This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Relaxation and .debug_loc section
- From: Michael Eager <eager at eagercon dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: binutils at sourceware dot org
- Date: Sat, 14 Jul 2007 08:59:41 -0700
- Subject: Re: Relaxation and .debug_loc section
- References: <469803B7.8090500@eagercon.com> <jewsx3h1p4.fsf@sykes.suse.de>
Andreas Schwab wrote:
Michael Eager <eager@eagercon.com> writes:
When the relaxation pass shrinks the code, these offsets
point to the wrong locations. I've looked through other
targets to see if there is anything which looks like it
fixes up the .debug_loc section after relaxation, but
I haven't found anything.
I think if you want to do linker relaxing you have to tell the assembler
not to resolve such relocations.
There's no way to do that. The offsets are simple expressions.
The assembler converts them to integer values.
The entries in the .debug_loc table look like the following:
$LLST2:
.4byte $LFB4-$Ltext0 <==
.4byte $LCFI8-$Ltext0 <==
.2byte 0x1
.byte 0x51
.4byte 0x0
.4byte 0x0
The values marked <== are offsets into the .text section and
need to be modified when the size of the section changes.
I'm writing the code to step through the .debug_loc data
and fix up these offsets. It's not complex, I just didn't
want to duplicate existing code.
Unfortunately, all of the relaxation code is target-dependent
code. Much of it could be common routines, with the target
specific code deciding which addresses need to be relaxed.
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077