From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116334 invoked by alias); 15 Mar 2017 05:55:24 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 116300 invoked by uid 89); 15 Mar 2017 05:55:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=ham version=3.3.2 spammy=DW_AT_low_pc, a2b, a23, 0000033c X-HELO: esa4.microchip.iphmx.com Received: from Unknown (HELO esa4.microchip.iphmx.com) (68.232.154.123) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 Mar 2017 05:55:22 +0000 Received: from exsmtp01.microchip.com (HELO email.microchip.com) ([198.175.253.37]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 14 Mar 2017 22:55:15 -0700 Received: from jaguar.microchip.com (10.10.76.4) by CHN-SV-EXCH01.mchp-main.com (10.10.76.37) with Microsoft SMTP Server id 14.3.181.6; Tue, 14 Mar 2017 22:55:14 -0700 References: <2BB0A51F073B384698CACFD1D5A30FCC24F429@glaexch3> User-agent: mu4e 0.9.18; emacs 25.1.1 From: Senthil Kumar Selvaraj To: James Bowman CC: "gdb@sourceware.org" Subject: Re: Relaxations vs debug info In-Reply-To: <2BB0A51F073B384698CACFD1D5A30FCC24F429@glaexch3> Date: Wed, 15 Mar 2017 05:55:00 -0000 Message-ID: <87mvcnozji.fsf@microchip.com> MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2017-03/txt/msg00020.txt.bz2 James Bowman writes: > 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: > > DW_AT_name : foo > DW_AT_decl_file : 1 > DW_AT_decl_line : 51 > DW_AT_prototyped : 1 > DW_AT_type : <0x5d> > DW_AT_low_pc : 0x33c > DW_AT_high_pc : 0x48 > > Unsurprisingly this confuses gdb. > > My question is: in relaxation, how does the gdb info get adjusted? 1. Are you seeing relocs at the offsets for ow_pc and high_pc in the debug_info section? 2. When relaxing, are you adjusting reloc values in debug sections as well? If the reloc value is sym + addend, and if the relaxation occurs between sym and addend, you'd obviously need to adjust the addend downwards. Regards Senthil