From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24647 invoked by alias); 19 Apr 2008 00:19:25 -0000 Received: (qmail 24638 invoked by uid 22791); 19 Apr 2008 00:19:24 -0000 X-Spam-Check-By: sourceware.org Received: from igw1.br.ibm.com (HELO igw1.br.ibm.com) (32.104.18.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 19 Apr 2008 00:19:02 +0000 Received: from mailhub3.br.ibm.com (mailhub3 [9.18.232.110]) by igw1.br.ibm.com (Postfix) with ESMTP id 6B26332C080 for ; Fri, 18 Apr 2008 20:56:21 -0300 (BRST) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.18.232.46]) by mailhub3.br.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m3J0J0Z04464766 for ; Fri, 18 Apr 2008 21:19:00 -0300 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m3J0IxFm013474 for ; Fri, 18 Apr 2008 21:18:59 -0300 Received: from [9.18.200.40] ([9.18.200.40]) by d24av01.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m3J0Ix7p013465 for ; Fri, 18 Apr 2008 21:18:59 -0300 Subject: [RFC] Remove exec_set_section_offsets From: Thiago Jung Bauermann To: GDB Patches Content-Type: text/plain Date: Sat, 19 Apr 2008 00:34:00 -0000 Message-Id: <1208564244.5808.95.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-04/txt/msg00392.txt.bz2 Hi, I found out that exec_set_section_offsets is not referenced anywhere, and the last ChangeLog entry related to it was in 1999, so this patch removes it. Tested by compiling on Linux/ppc32. Is this ok? Perhaps it would qualify as obvious, but I'm not used to removing code from GDB so better ask about it... 2008-04-18 Thiago Jung Bauermann * defs.h (exec_set_section_offsets): Remove prototype. * exec.c (exec_set_section_offsets): Remove function. diff -r f3cbd26c0c0d gdb/defs.h --- a/gdb/defs.h Fri Apr 18 03:15:14 2008 -0700 +++ b/gdb/defs.h Fri Apr 18 16:54:45 2008 -0700 @@ -602,10 +602,6 @@ extern void init_last_source_visited (vo extern void init_last_source_visited (void); /* From exec.c */ - -extern void exec_set_section_offsets (bfd_signed_vma text_off, - bfd_signed_vma data_off, - bfd_signed_vma bss_off); /* Take over the 'find_mapped_memory' vector from exec.c. */ extern void exec_set_find_memory_regions (int (*) (int (*) (CORE_ADDR, diff -r f3cbd26c0c0d gdb/exec.c --- a/gdb/exec.c Fri Apr 18 03:15:14 2008 -0700 +++ b/gdb/exec.c Fri Apr 18 16:54:45 2008 -0700 @@ -598,42 +598,6 @@ exec_files_info (struct target_ops *t) } } -/* msnyder 5/21/99: - exec_set_section_offsets sets the offsets of all the sections - in the exec objfile. */ - -void -exec_set_section_offsets (bfd_signed_vma text_off, bfd_signed_vma data_off, - bfd_signed_vma bss_off) -{ - struct section_table *sect; - - for (sect = exec_ops.to_sections; - sect < exec_ops.to_sections_end; - sect++) - { - flagword flags; - - flags = bfd_get_section_flags (exec_bfd, sect->the_bfd_section); - - if (flags & SEC_CODE) - { - sect->addr += text_off; - sect->endaddr += text_off; - } - else if (flags & (SEC_DATA | SEC_LOAD)) - { - sect->addr += data_off; - sect->endaddr += data_off; - } - else if (flags & SEC_ALLOC) - { - sect->addr += bss_off; - sect->endaddr += bss_off; - } - } -} - static void set_section_command (char *args, int from_tty) { -- []'s Thiago Jung Bauermann Software Engineer IBM Linux Technology Center