This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Relaxations vs debug info
- From: James Bowman <james dot bowman at ftdichip dot com>
- To: "gdb at sourceware dot org" <gdb at sourceware dot org>
- Date: Wed, 15 Mar 2017 00:04:17 +0000
- Subject: Relaxations vs debug info
- Authentication-results: sourceware.org; auth=none
I am working on some linker relaxations for my target, using existing
relaxation implementations as my pattern.
Everything seems to be working: relaxations are being applied, for example
relaxation reduces the size of function foo from 0x48 to 0x38 bytes.
Checking symbols, it looks good:
$ ft32-elf-objdump -t a.out | grep foo
0000033c g F .text 00000038 foo
However when I look at the debug info (objdump -g) I see that the size is still 0x48:
<a1d> DW_AT_name : foo
<a21> DW_AT_decl_file : 1
<a22> DW_AT_decl_line : 51
<a23> DW_AT_prototyped : 1
<a23> DW_AT_type : <0x5d>
<a27> DW_AT_low_pc : 0x33c
<a2b> DW_AT_high_pc : 0x48
Unsurprisingly this confuses gdb.
My question is: in relaxation, how does the gdb info get adjusted?