]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld: pass -g for ld-elf tests
authorSam James <sam@gentoo.org>
Sat, 29 Jun 2024 10:07:18 +0000 (11:07 +0100)
committerSam James <sam@gentoo.org>
Sat, 29 Jun 2024 16:19:39 +0000 (17:19 +0100)
The "DWARF parse during linker error" and "Build warn libbar.so" tests
require debug information.

configure defaults to "-O2 -g" but if overriding *FLAGS when building
tests, this might be lost. Explicitly pass -g given these tests require
it.

Originally reported downstream in Gentoo at https://bugs.gentoo.org/934149.

ld/
* testsuite/ld-elf/dwarf.exp: Pass -g for "DWARF parse during linker error".
* testsuite/ld-elf/shared.exp: Ditto for "Build warn libbar.so".

(cherry picked from commit 17c78a23491ce76fd6d21cdbf2db3c0cf02145e0)

ld/testsuite/ld-elf/dwarf.exp
ld/testsuite/ld-elf/shared.exp

index 6a63269562ce87f66a9a7e7909e47a752ee2c1e9..670551f88ad2412c529868d50a718d69c9a07e3d 100644 (file)
@@ -50,7 +50,7 @@ set build_tests {
    "-s -shared" "-fPIC -g -feliminate-dwarf2-dups"
    {dwarf1.c} {} "libdwarf1.so"}
   {"DWARF parse during linker error"
-   "" "-fno-toplevel-reorder"
+   "" "-g -fno-toplevel-reorder"
    {dwarf2a.c dwarf2b.c} {{error_output "dwarf2.err"}} "dwarf2.x"}
   {"Handle no DWARF information"
    "" "-g0"
index 277dc7bf2de6b8cb85d193e3ac03672f8fe36d65..d811738de76c53d866b4f421ec92a9bf0d13ccaf 100644 (file)
@@ -552,7 +552,7 @@ set build_tests {
    "-shared" "-fPIC"
    {begin.c end.c} {} "libbar.so"}
   {"Build warn libbar.so"
-   "-shared" "-fPIC"
+   "-shared" "-fPIC -g"
   {beginwarn.c end.c}
   {{readelf {-S --wide} libbarw.rd}
    {warning {^.*beginwarn.c:7:\(.*\): warning: function foo is deprecated\n?$}}}