* [patch] Fix false warning: section .gnu.liblist not found in ...
@ 2010-02-13 22:49 Jan Kratochvil
2010-02-28 23:14 ` [patch] Fix false warning: section .gnu.liblist not found in ... [rediffed] Jan Kratochvil
0 siblings, 1 reply; 6+ messages in thread
From: Jan Kratochvil @ 2010-02-13 22:49 UTC (permalink / raw)
To: gdb-patches; +Cc: Jakub Jelinek
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 <gingold@adacore.com>
* 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 <jan.kratochvil@redhat.com>
* 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;
}
}
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [patch] Fix false warning: section .gnu.liblist not found in ... [rediffed]
2010-02-13 22:49 [patch] Fix false warning: section .gnu.liblist not found in Jan Kratochvil
@ 2010-02-28 23:14 ` Jan Kratochvil
2010-03-08 7:23 ` Joel Brobecker
0 siblings, 1 reply; 6+ messages in thread
From: Jan Kratochvil @ 2010-02-28 23:14 UTC (permalink / raw)
To: gdb-patches
Hi,
only a technical rediff.
------------------------------------------------------------------------------
On Sat, 13 Feb 2010 23:49:29 +0100, Jan Kratochvil wrote:
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 <gingold@adacore.com>
* 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-03-01 Jan Kratochvil <jan.kratochvil@redhat.com>
* symfile.c (addr_info_make_relative): New variable sect_name, use it.
Do not warn on ".gnu.liblist" and ".gnu.conflict".
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -597,7 +597,8 @@ addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd)
for (i = 0; i < addrs->num_sections && addrs->other[i].name; i++)
{
- asection *sect = bfd_get_section_by_name (abfd, addrs->other[i].name);
+ const char *sect_name = addrs->other[i].name;
+ asection *sect = bfd_get_section_by_name (abfd, sect_name);
if (sect)
{
@@ -614,8 +615,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 so 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 (sect_name, ".gnu.liblist") == 0
+ || strcmp (sect_name, ".gnu.conflict") == 0))
+ warning (_("section %s not found in %s"), sect_name,
+ bfd_get_filename (abfd));
+
addrs->other[i].addr = 0;
/* SECTINDEX is invalid if ADDR is zero. */
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [patch] Fix false warning: section .gnu.liblist not found in ... [rediffed]
2010-02-28 23:14 ` [patch] Fix false warning: section .gnu.liblist not found in ... [rediffed] Jan Kratochvil
@ 2010-03-08 7:23 ` Joel Brobecker
2010-03-08 7:57 ` Jan Kratochvil
0 siblings, 1 reply; 6+ messages in thread
From: Joel Brobecker @ 2010-03-08 7:23 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
> 2010-03-01 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> * symfile.c (addr_info_make_relative): New variable sect_name, use it.
> Do not warn on ".gnu.liblist" and ".gnu.conflict".
This looks reasonable. We can go with that at least for now, but I am
wondering whether we might want to consider using a complaint instead
if more sections like these keep popping up.
I have a small request:
> + /* These two sections are intentionally loaded into memory from
> + the DYNAMIC segment and so 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 (sect_name, ".gnu.liblist") == 0
> + || strcmp (sect_name, ".gnu.conflict") == 0))
> + warning (_("section %s not found in %s"), sect_name,
> + bfd_get_filename (abfd));
> +
I was a little confused at first by the comment, because it immediately
mentioned "these two sections" without giving an idea of what these
sections were. May I suggest maybe something more detailed like so?
/* This section does not exist in ABFD, which is normally
unexpected and we want to issue a warning.
However, the ELF prelinker does create a couple of sections
(".gnu.liblist" and ".gnu.conflict") which are marked as
loadable (they are loaded in memory from the DYNAMIC segment)
and yet are not present in separate debug info files. This
is fine, and should not cause a warning. */
--
Joel
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [patch] Fix false warning: section .gnu.liblist not found in ... [rediffed]
2010-03-08 7:23 ` Joel Brobecker
@ 2010-03-08 7:57 ` Jan Kratochvil
2010-03-08 8:17 ` Joel Brobecker
0 siblings, 1 reply; 6+ messages in thread
From: Jan Kratochvil @ 2010-03-08 7:57 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
On Mon, 08 Mar 2010 08:23:17 +0100, Joel Brobecker wrote:
> > 2010-03-01 Jan Kratochvil <jan.kratochvil@redhat.com>
> >
> > * symfile.c (addr_info_make_relative): New variable sect_name, use it.
> > Do not warn on ".gnu.liblist" and ".gnu.conflict".
>
> This looks reasonable. We can go with that at least for now,
> but I am wondering whether we might want to consider using a complaint
> instead if more sections like these keep popping up.
I have checked prelink sources and IIUC there are no other sections than
".gnu.liblist" and ".gnu.conflict" with this behavior/problem. I do not agree
with this one sentence but I believe it is offtopic for this patch/thread.
> I have a small request:
>
> > + /* These two sections are intentionally loaded into memory from
> > + the DYNAMIC segment and so 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 (sect_name, ".gnu.liblist") == 0
> > + || strcmp (sect_name, ".gnu.conflict") == 0))
> > + warning (_("section %s not found in %s"), sect_name,
> > + bfd_get_filename (abfd));
> > +
>
> I was a little confused at first by the comment, because it immediately
> mentioned "these two sections" without giving an idea of what these
> sections were. May I suggest maybe something more detailed like so?
>
> /* This section does not exist in ABFD, which is normally
> unexpected and we want to issue a warning.
>
> However, the ELF prelinker does create a couple of sections
> (".gnu.liblist" and ".gnu.conflict") which are marked as
> loadable (they are loaded in memory from the DYNAMIC segment)
> and yet are not present in separate debug info files. This
> is fine, and should not cause a warning. */
OK, thanks.
Just the main executable vs. shared library files difference was omitted there.
This difference was IIRC the main cost while investigating this problem
therefore I would like to keep the note there:
/* This section does not exist in ABFD, which is normally
unexpected and we want to issue a warning.
However, the ELF prelinker does create a couple of sections
(".gnu.liblist" and ".gnu.conflict") which are marked in the main
executable as loadable (they are loaded in memory from the
DYNAMIC segment) and yet are not present in separate debug info
files. This is fine, and should not cause a warning. Shared
libraries contain just the section ".gnu.liblist" but it is not
marked as loadable there. */
As the comment is already being discusses is approved even this variant?
Thanks for the review,
Jan
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [patch] Fix false warning: section .gnu.liblist not found in ... [rediffed]
2010-03-08 7:57 ` Jan Kratochvil
@ 2010-03-08 8:17 ` Joel Brobecker
2010-03-08 8:37 ` Jan Kratochvil
0 siblings, 1 reply; 6+ messages in thread
From: Joel Brobecker @ 2010-03-08 8:17 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
> /* This section does not exist in ABFD, which is normally
> unexpected and we want to issue a warning.
>
> However, the ELF prelinker does create a couple of sections
> (".gnu.liblist" and ".gnu.conflict") which are marked in the main
> executable as loadable (they are loaded in memory from the
> DYNAMIC segment) and yet are not present in separate debug info
> files. This is fine, and should not cause a warning. Shared
> libraries contain just the section ".gnu.liblist" but it is not
> marked as loadable there. */
>
> As the comment is already being discusses is approved even this variant?
This is even better, the omission was not intentional.
--
Joel
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [patch] Fix false warning: section .gnu.liblist not found in ... [rediffed]
2010-03-08 8:17 ` Joel Brobecker
@ 2010-03-08 8:37 ` Jan Kratochvil
0 siblings, 0 replies; 6+ messages in thread
From: Jan Kratochvil @ 2010-03-08 8:37 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
Hi Joel,
checked-in.
(Not checked-in for 7.1 as it is both a minor issue and also rather a distro
integration issue.)
Thanks,
Jan
http://sourceware.org/ml/gdb-cvs/2010-03/msg00066.html
--- src/gdb/ChangeLog 2010/03/08 07:45:49 1.11442
+++ src/gdb/ChangeLog 2010/03/08 08:32:49 1.11443
@@ -1,3 +1,8 @@
+2010-03-08 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * symfile.c (addr_info_make_relative): New variable sect_name, use it.
+ Do not warn on ".gnu.liblist" and ".gnu.conflict".
+
2010-03-08 Joel Brobecker <brobecker@adacore.com>
Memory error when reading wrong core file.
--- src/gdb/symfile.c 2010/03/05 19:32:44 1.275
+++ src/gdb/symfile.c 2010/03/08 08:32:49 1.276
@@ -592,7 +592,8 @@
for (i = 0; i < addrs->num_sections && addrs->other[i].name; i++)
{
- asection *sect = bfd_get_section_by_name (abfd, addrs->other[i].name);
+ const char *sect_name = addrs->other[i].name;
+ asection *sect = bfd_get_section_by_name (abfd, sect_name);
if (sect)
{
@@ -609,8 +610,22 @@
}
else
{
- warning (_("section %s not found in %s"), addrs->other[i].name,
- bfd_get_filename (abfd));
+ /* This section does not exist in ABFD, which is normally
+ unexpected and we want to issue a warning.
+
+ However, the ELF prelinker does create a couple of sections
+ (".gnu.liblist" and ".gnu.conflict") which are marked in the main
+ executable as loadable (they are loaded in memory from the
+ DYNAMIC segment) and yet are not present in separate debug info
+ files. This is fine, and should not cause a warning. Shared
+ libraries contain just the section ".gnu.liblist" but it is not
+ marked as loadable there. */
+
+ if (!(strcmp (sect_name, ".gnu.liblist") == 0
+ || strcmp (sect_name, ".gnu.conflict") == 0))
+ warning (_("section %s not found in %s"), sect_name,
+ bfd_get_filename (abfd));
+
addrs->other[i].addr = 0;
/* SECTINDEX is invalid if ADDR is zero. */
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-03-08 8:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-13 22:49 [patch] Fix false warning: section .gnu.liblist not found in Jan Kratochvil
2010-02-28 23:14 ` [patch] Fix false warning: section .gnu.liblist not found in ... [rediffed] Jan Kratochvil
2010-03-08 7:23 ` Joel Brobecker
2010-03-08 7:57 ` Jan Kratochvil
2010-03-08 8:17 ` Joel Brobecker
2010-03-08 8:37 ` Jan Kratochvil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox