From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20986 invoked by alias); 13 Feb 2010 22:49:38 -0000 Received: (qmail 20977 invoked by uid 22791); 13 Feb 2010 22:49:37 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 13 Feb 2010 22:49:32 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1DMnVqR008850 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 13 Feb 2010 17:49:31 -0500 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1DMnTg1005494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 13 Feb 2010 17:49:30 -0500 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id o1DMnT7x027602; Sat, 13 Feb 2010 23:49:29 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id o1DMnTeg027601; Sat, 13 Feb 2010 23:49:29 +0100 Date: Sat, 13 Feb 2010 22:49:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Cc: Jakub Jelinek Subject: [patch] Fix false warning: section .gnu.liblist not found in ... Message-ID: <20100213224929.GB27252@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-08-17) 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: 2010-02/txt/msg00345.txt.bz2 Hi, post-7.0 GDB started to print many false warnings on prelink-ed system: $ ./gdb -nx -ex r echo ... Reading symbols from /bin/echo...Reading symbols from /usr/lib/debug/bin/echo.debug... warning: section .gnu.liblist not found in /usr/lib/debug/bin/echo.debug warning: section .gnu.conflict not found in /usr/lib/debug/bin/echo.debug done. done. Starting program: /bin/echo warning: section .gnu.liblist not found in /usr/lib/debug/bin/echo.debug warning: section .gnu.conflict not found in /usr/lib/debug/bin/echo.debug warning: section .gnu.liblist not found in /usr/lib/debug/bin/echo.debug warning: section .gnu.conflict not found in /usr/lib/debug/bin/echo.debug warning: section .gnu.liblist not found in /usr/lib/debug/bin/echo.debug warning: section .gnu.conflict not found in /usr/lib/debug/bin/echo.debug These sections are from prelink and they are not present in the *.debug files. It is formally a regression by: commit 3bfec189bb0fa1a2a44f1645dd68a9572e7a841c 2010-01-07 Tristan Gingold * symfile.c (build_section_addr_info_from_objfile): New function. (symbol_file_add_separate): Don't use offsets from objfile but built an addr info. But I think would be unavoidable even for the unification of PIC+PIE handling. Found no usable section flag differences for .gnu.liblist vs. for example .text so used just the section name for the exception. .gnu.liblist/.gnu.conflict related dumps: executable: Section Headers: [Nr] Name Type Address Off Size ES Flg Lk Inf Al [ 6] .gnu.liblist GNU_LIBLIST 00000000004006b8 0006b8 000028 14 A 28 0 4 [ 7] .gnu.conflict RELA 00000000004006e0 0006e0 0001c8 18 A 5 0 8 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x000000 0x0000000000400000 0x0000000000400000 0x005254 0x005254 R E 0x200000 Dynamic section at offset 0x52c8 contains 24 entries: Tag Type Name/Value 0x000000006ffffef9 (GNU_LIBLIST) 0x4006b8 0x000000006ffffdf7 (GNU_LIBLISTSZ) 40 (bytes) 0x000000006ffffef8 (GNU_CONFLICT) 0x4006e0 0x000000006ffffdf6 (GNU_CONFLICTSZ) 456 (bytes) library: Section Headers: [Nr] Name Type Address Off Size ES Flg Lk Inf Al [74] .gnu.liblist GNU_LIBLIST 0000000000000000 249940 000014 14 75 0 4 No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu. Thanks, Jan 2010-02-13 Jan Kratochvil * symfile.c (addr_info_make_relative): Move variable sect into a more inner block. New variable name. Do not warn on ".gnu.liblist" and ".gnu.conflict". --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -568,7 +568,6 @@ void addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd) { asection *lower_sect; - asection *sect; CORE_ADDR lower_offset; int i; @@ -601,7 +600,9 @@ addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd) { if (addrs->other[i].addr != 0) { - sect = bfd_get_section_by_name (abfd, addrs->other[i].name); + const char *name = addrs->other[i].name; + asection *sect = bfd_get_section_by_name (abfd, name); + if (sect) { addrs->other[i].addr -= bfd_section_vma (abfd, sect); @@ -611,8 +612,16 @@ addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd) } else { - warning (_("section %s not found in %s"), addrs->other[i].name, - bfd_get_filename (abfd)); + /* These two sections are intentionally loaded into memory from + the DYNAMIC segment and they have both SEC_ALLOC and SEC_LOAD + set in the main executable (not in the library files). They + are not present in the separate debug info file, though. */ + + if (!(strcmp (name, ".gnu.liblist") == 0 + || strcmp (name, ".gnu.conflict") == 0)) + warning (_("section %s not found in %s"), addrs->other[i].name, + bfd_get_filename (abfd)); + addrs->other[i].addr = 0; } }