* [2.41 PATCH 01/10] gprofng: 30700 tmpdir/gp-collect-app_F test fails
2023-12-16 4:01 [2.41 PATCH 00/10] Misc binutils-2.41 test fixes Sam James
@ 2023-12-16 4:01 ` Sam James
2023-12-16 4:01 ` [2.41 PATCH 02/10] Fix "--only-keep-debug for ELF relocatables" binutils test for compilers which add .debug_macro sections to object files Sam James
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Sam James @ 2023-12-16 4:01 UTC (permalink / raw)
To: binutils; +Cc: nickc, Vladimir Mezentsev
From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
gprofng/ChangeLog
2023-08-03 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
PR gprofng/30700
* testsuite/gprofng.display/gp-collect-app_F.exp: Fix -name argument
for sub-experiment filtering.
(cherry picked from commit e0282cf1284b4d358892427a6b4f60d6f4c0580b)
---
gprofng/testsuite/gprofng.display/gp-collect-app_F.exp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gprofng/testsuite/gprofng.display/gp-collect-app_F.exp b/gprofng/testsuite/gprofng.display/gp-collect-app_F.exp
index f791b0f7a95..02bcc8e5b49 100644
--- a/gprofng/testsuite/gprofng.display/gp-collect-app_F.exp
+++ b/gprofng/testsuite/gprofng.display/gp-collect-app_F.exp
@@ -46,11 +46,11 @@ proc run_gp_collect_app { subExpCnt F_opt } {
return -code break
}
- set output [run_native_host_cmd "find $tdir -name '*x1.er' | wc -l"]
+ set output [run_native_host_cmd "find $tdir -name '*_x?.er' | wc -l"]
set subExp [lindex $output 1]
if { $subExp != $subExpCnt } then {
set out [lindex $output 1]
- send_log "Test failed for -F $F_opt. subExp=$subExp. Shold be $subExpCnt\n"
+ send_log "Test failed for -F $F_opt. subExp=$subExp. Should be $subExpCnt\n"
fail $tdir
return -code break
}
--
2.43.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [2.41 PATCH 02/10] Fix "--only-keep-debug for ELF relocatables" binutils test for compilers which add .debug_macro sections to object files.
2023-12-16 4:01 [2.41 PATCH 00/10] Misc binutils-2.41 test fixes Sam James
2023-12-16 4:01 ` [2.41 PATCH 01/10] gprofng: 30700 tmpdir/gp-collect-app_F test fails Sam James
@ 2023-12-16 4:01 ` Sam James
2023-12-16 4:01 ` [2.41 PATCH 03/10] ld: Build libpr23169a.so with -z lazy Sam James
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Sam James @ 2023-12-16 4:01 UTC (permalink / raw)
To: binutils; +Cc: nickc
From: Nick Clifton <nickc@redhat.com>
PR 30699
* binutils/testsuite/binutils-all/objcopy.exp (keep_debug_symbols_for_elf_relocatable): Do not add sections containing the string "debug_" to the list of non-debug sections.
(cherry picked from commit b99a9693430a9f04165b1b868f890b622bb1b46c)
---
binutils/testsuite/binutils-all/objcopy.exp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index 1145835d8b7..41070c3e0de 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -1028,7 +1028,11 @@ proc keep_debug_symbols_for_elf_relocatable { prog flags test } {
{[^a-zA-Z]+([a-zA-Z0-9_\.]+)[ \t]+([A-Z]+)[ \t]+[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ [0-9]+[ \t]+([A-Z]*)[ \t]+[0-9]+(.*)} \
$got all name type flag rest] } {
if { $type != "NOTE" && [regexp {[AG]} $flag] } {
- lappend non_debug_sections $name
+ # PR 30699: Some debug sections can be in a group, so
+ # exclude sections whose name includes "debug_"
+ if { ! [regexp {debug_} $name] } {
+ lappend non_debug_sections $name
+ }
}
set got $rest
}
@@ -1086,6 +1090,7 @@ switch [copy_setup] {
untested $test5
if [is_elf_format] {
untested $test6
+ untested $test7
}
}
"3" {
--
2.43.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [2.41 PATCH 03/10] ld: Build libpr23169a.so with -z lazy
2023-12-16 4:01 [2.41 PATCH 00/10] Misc binutils-2.41 test fixes Sam James
2023-12-16 4:01 ` [2.41 PATCH 01/10] gprofng: 30700 tmpdir/gp-collect-app_F test fails Sam James
2023-12-16 4:01 ` [2.41 PATCH 02/10] Fix "--only-keep-debug for ELF relocatables" binutils test for compilers which add .debug_macro sections to object files Sam James
@ 2023-12-16 4:01 ` Sam James
2023-12-16 4:01 ` [2.41 PATCH 04/10] ld: Fix relocatable.d XFAIL/notarget entry for hppa Sam James
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Sam James @ 2023-12-16 4:01 UTC (permalink / raw)
To: binutils; +Cc: nickc, H.J. Lu
From: "H.J. Lu" <hjl.tools@gmail.com>
pr23169b test only works with lazy binding. To work with linker which
disables lazy binding by default, build pr23169b binaries with -z lazy.
PR ld/30698
* ld-ifunc/ifunc.exp: Build pr23169b binaries with -z lazy.
(cherry picked from commit 51dd9e7c4cab13748f31f6575aed0672f03d6710)
---
ld/testsuite/ld-ifunc/ifunc.exp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ld/testsuite/ld-ifunc/ifunc.exp b/ld/testsuite/ld-ifunc/ifunc.exp
index edabcc3f744..2bf656e73b2 100644
--- a/ld/testsuite/ld-ifunc/ifunc.exp
+++ b/ld/testsuite/ld-ifunc/ifunc.exp
@@ -604,7 +604,7 @@ run_cc_link_tests [list \
] \
[list \
"Build libpr23169a.so" \
- "-shared" \
+ "-shared -Wl,-z,lazy" \
"-fPIC -O2 -g" \
{ pr23169a.c } \
{} \
@@ -751,7 +751,7 @@ run_ld_link_exec_tests [list \
] \
[list \
"Run pr23169b" \
- "-pie -Wl,--no-as-needed tmpdir/libpr23169a.so" \
+ "-pie -Wl,--no-as-needed,-z,lazy tmpdir/libpr23169a.so" \
"" \
{ pr23169b.c pr23169c.c } \
"pr23169b" \
--
2.43.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [2.41 PATCH 04/10] ld: Fix relocatable.d XFAIL/notarget entry for hppa
2023-12-16 4:01 [2.41 PATCH 00/10] Misc binutils-2.41 test fixes Sam James
` (2 preceding siblings ...)
2023-12-16 4:01 ` [2.41 PATCH 03/10] ld: Build libpr23169a.so with -z lazy Sam James
@ 2023-12-16 4:01 ` Sam James
2023-12-16 4:01 ` [2.41 PATCH 05/10] ld: Fix retain7a.d " Sam James
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Sam James @ 2023-12-16 4:01 UTC (permalink / raw)
To: binutils; +Cc: nickc, Sam James
PR 30734
* ld/testsuite/ld-elf/relocatable.d: Fix notarget entry for hppa to match
hppa{1.1,2.0}*, like hppa2.0-unknown-linux-gnu which Gentoo uses.
Signed-off-by: Sam James <sam@gentoo.org>
(cherry picked from commit 0e339f6b4f2df25ed351cb94dc7fe16868626f49)
---
ld/testsuite/ld-elf/relocatable.d | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ld/testsuite/ld-elf/relocatable.d b/ld/testsuite/ld-elf/relocatable.d
index d0fba97a104..cb39baa52bc 100644
--- a/ld/testsuite/ld-elf/relocatable.d
+++ b/ld/testsuite/ld-elf/relocatable.d
@@ -2,7 +2,7 @@
#source: simple.s
#ld: -r -T relocatable.t
#readelf: -S --wide
-#xfail: hppa-*-*
+#xfail: hppa*-*-*
#...
\[[ 0-9]+\] \.text.*[ \t]+PROGBITS[ \t]+0+800000[ \t0-9a-f]+AX.*
--
2.43.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [2.41 PATCH 05/10] ld: Fix retain7a.d XFAIL/notarget entry for hppa
2023-12-16 4:01 [2.41 PATCH 00/10] Misc binutils-2.41 test fixes Sam James
` (3 preceding siblings ...)
2023-12-16 4:01 ` [2.41 PATCH 04/10] ld: Fix relocatable.d XFAIL/notarget entry for hppa Sam James
@ 2023-12-16 4:01 ` Sam James
2023-12-16 4:01 ` [2.41 PATCH 06/10] ld: fix relocatable, retain7a target pattens for HPPA Sam James
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Sam James @ 2023-12-16 4:01 UTC (permalink / raw)
To: binutils; +Cc: nickc, Sam James
PR 30733
* ld/testsuite/ld-elf/retain7a.d: Fix XFAIL entry for hppa to match
hppa{1.1,2.0}*, like hppa2.0-unknown-linux-gnu which Gentoo uses.
Signed-off-by: Sam James <sam@gentoo.org>
(cherry picked from commit e3b66187192ce6840df283c00f6395bb0ff15cf5)
---
ld/testsuite/ld-elf/retain7a.d | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ld/testsuite/ld-elf/retain7a.d b/ld/testsuite/ld-elf/retain7a.d
index 314fe0f5733..38d9a9ba255 100644
--- a/ld/testsuite/ld-elf/retain7a.d
+++ b/ld/testsuite/ld-elf/retain7a.d
@@ -2,7 +2,7 @@
#source: retain7.s
#ld: -e _start --gc-sections
# hppa-linux chooses ELFOSABI_GNU regardless of GNU feature use
-#notarget: ![supports_gnu_osabi] ![check_gc_sections_available] hppa-*-linux*
+#notarget: ![supports_gnu_osabi] ![check_gc_sections_available] hppa*-*-linux*
#readelf: -h
#failif
--
2.43.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [2.41 PATCH 06/10] ld: fix relocatable, retain7a target pattens for HPPA
2023-12-16 4:01 [2.41 PATCH 00/10] Misc binutils-2.41 test fixes Sam James
` (4 preceding siblings ...)
2023-12-16 4:01 ` [2.41 PATCH 05/10] ld: Fix retain7a.d " Sam James
@ 2023-12-16 4:01 ` Sam James
2023-12-16 4:01 ` [2.41 PATCH 07/10] ld: ld-lib.exp: log failed dump.out contents for debugging Sam James
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Sam James @ 2023-12-16 4:01 UTC (permalink / raw)
To: binutils; +Cc: nickc, Sam James
Fix issue reported by Dave and Alan.
Put back the old pattern for hppa-*-linux* and add hppa[12]*-*-linux* to cover
Gentoo's hppa1.1 and hppa2.0 without including hppa64 inadvertently like I did
before.
ld/
PR 30733
PR 30734
* ld/testsuite/ld-elf/relocatable.d: Use better pattern to exclude hppa64
but include hppa1.1, hppa2.0.
* ld/testsuite/ld-elf/retain7a.d: Ditto.
Fixes: 0e339f6b4f2df25ed351cb94dc7fe16868626f49
Fixes: e3b66187192ce6840df283c00f6395bb0ff15cf5
Signed-off-by: Sam James <sam@gentoo.org>
(cherry picked from commit 3b23a5ea693deee60648c9a9e9d666d83549298e)
---
ld/testsuite/ld-elf/relocatable.d | 2 +-
ld/testsuite/ld-elf/retain7a.d | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ld/testsuite/ld-elf/relocatable.d b/ld/testsuite/ld-elf/relocatable.d
index cb39baa52bc..33a04912fd0 100644
--- a/ld/testsuite/ld-elf/relocatable.d
+++ b/ld/testsuite/ld-elf/relocatable.d
@@ -2,7 +2,7 @@
#source: simple.s
#ld: -r -T relocatable.t
#readelf: -S --wide
-#xfail: hppa*-*-*
+#xfail: hppa-*-* hppa[12]*-*-*
#...
\[[ 0-9]+\] \.text.*[ \t]+PROGBITS[ \t]+0+800000[ \t0-9a-f]+AX.*
diff --git a/ld/testsuite/ld-elf/retain7a.d b/ld/testsuite/ld-elf/retain7a.d
index 38d9a9ba255..406aaa40ad5 100644
--- a/ld/testsuite/ld-elf/retain7a.d
+++ b/ld/testsuite/ld-elf/retain7a.d
@@ -2,7 +2,7 @@
#source: retain7.s
#ld: -e _start --gc-sections
# hppa-linux chooses ELFOSABI_GNU regardless of GNU feature use
-#notarget: ![supports_gnu_osabi] ![check_gc_sections_available] hppa*-*-linux*
+#notarget: ![supports_gnu_osabi] ![check_gc_sections_available] hppa-*-linux* hppa[12]*-*-linux*
#readelf: -h
#failif
--
2.43.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [2.41 PATCH 07/10] ld: ld-lib.exp: log failed dump.out contents for debugging
2023-12-16 4:01 [2.41 PATCH 00/10] Misc binutils-2.41 test fixes Sam James
` (5 preceding siblings ...)
2023-12-16 4:01 ` [2.41 PATCH 06/10] ld: fix relocatable, retain7a target pattens for HPPA Sam James
@ 2023-12-16 4:01 ` Sam James
2023-12-16 4:01 ` [2.41 PATCH 08/10] ld/x86: reduce testsuite dependency on system object files Sam James
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Sam James @ 2023-12-16 4:01 UTC (permalink / raw)
To: binutils; +Cc: nickc, Sam James
If we're using dump_prog in a test which fails, log the dump.out contents
to ld.log to aid debugging.
This avoids needing to ask reporters to manually run e.g. `objdump` commands
when making bug reports.
PR30722
* ld/testsuite/lib/ld-lib.exp: Log failed dump.out contents to aid
debugging.
Approved-by: Nick Clifton <nickc@redhat.com>
Signed-off-by: Sam James <sam@gentoo.org>
(cherry picked from commit 646657284f6b62a71a6869826e951b3def4d73a6)
---
ld/testsuite/lib/ld-lib.exp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 918464069a9..aca303e0728 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -640,7 +640,7 @@ proc run_ld_link_tests { ldtests args } {
remote_upload host "dump.out"
if { [regexp_diff "dump.out" "$srcdir/$subdir/$dumpfile"] } then {
- verbose "output is [file_contents "dump.out"]" 2
+ verbose -log "output is [file_contents "dump.out"]" 2
set failed 1
remote_file build delete "dump.out"
remote_file host delete "dump.out"
@@ -1067,7 +1067,7 @@ proc run_cc_link_tests { ldtests } {
}
if { [regexp_diff "dump.out" "$srcdir/$subdir/$dumpfile"] } then {
- verbose "output is [file_contents "dump.out"]" 2
+ verbose -log "output is [file_contents "dump.out"]" 2
set failed 1
break
}
--
2.43.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [2.41 PATCH 08/10] ld/x86: reduce testsuite dependency on system object files
2023-12-16 4:01 [2.41 PATCH 00/10] Misc binutils-2.41 test fixes Sam James
` (6 preceding siblings ...)
2023-12-16 4:01 ` [2.41 PATCH 07/10] ld: ld-lib.exp: log failed dump.out contents for debugging Sam James
@ 2023-12-16 4:01 ` Sam James
2023-12-16 4:01 ` [2.41 PATCH 09/10] Fix " Sam James
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Sam James @ 2023-12-16 4:01 UTC (permalink / raw)
To: binutils; +Cc: nickc, Jan Beulich
From: Jan Beulich <jbeulich@suse.com>
PR ld/30722
Tests looking for certain .note-section recorded properties may not
involve object files from the underlying platform (e.g. via using the C
compiler for linking): Such object files may themselves have similar
note sections, and hence they may influence the overall outcome.
For now convert just the tests known to be affected by crt*.o coming
with "ISA v3 needed" notes. Eventually other tests ought to be
converted, too.
(cherry picked from commit eab996435fe65a421541f59557c5f1fd427573a3)
---
ld/testsuite/ld-x86-64/property-stk.s | 25 +++
.../{property-x86-1.S => property-x86-1.s} | 15 +-
.../{property-x86-2.S => property-x86-2.s} | 15 +-
ld/testsuite/ld-x86-64/x86-64.exp | 170 +++++++++---------
4 files changed, 131 insertions(+), 94 deletions(-)
create mode 100644 ld/testsuite/ld-x86-64/property-stk.s
rename ld/testsuite/ld-x86-64/{property-x86-1.S => property-x86-1.s} (75%)
rename ld/testsuite/ld-x86-64/{property-x86-2.S => property-x86-2.s} (70%)
diff --git a/ld/testsuite/ld-x86-64/property-stk.s b/ld/testsuite/ld-x86-64/property-stk.s
new file mode 100644
index 00000000000..b3c7c4ee7af
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/property-stk.s
@@ -0,0 +1,25 @@
+ .ifdef __64_bit__
+ .equ ALIGN, 3
+ .else
+ .equ ALIGN, 2
+ .endif
+
+ .section ".note.gnu.property", "a"
+ .p2align ALIGN
+ .long 1f - 0f /* name length. */
+ .long 3f - 1f /* data length. */
+ /* NT_GNU_PROPERTY_TYPE_0 */
+ .long 5 /* note type. */
+0:
+ .asciz "GNU" /* vendor name. */
+1:
+ .p2align ALIGN
+ /* GNU_PROPERTY_STACK_SIZE */
+ .long 1 /* pr_type. */
+ .long 5f - 4f /* pr_datasz. */
+4:
+ .dc.a 0x800000 /* Stack size. */
+5:
+ .p2align ALIGN
+3:
+ .section .note.GNU-stack
diff --git a/ld/testsuite/ld-x86-64/property-x86-1.S b/ld/testsuite/ld-x86-64/property-x86-1.s
similarity index 75%
rename from ld/testsuite/ld-x86-64/property-x86-1.S
rename to ld/testsuite/ld-x86-64/property-x86-1.s
index 6d1d8fbaef5..3e3f707bacc 100644
--- a/ld/testsuite/ld-x86-64/property-x86-1.S
+++ b/ld/testsuite/ld-x86-64/property-x86-1.s
@@ -1,8 +1,9 @@
-#ifdef __LP64__
-# define ALIGN 3
-#else
-# define ALIGN 2
-#endif
+ .ifdef __64_bit__
+ .equ ALIGN, 3
+ .else
+ .equ ALIGN, 2
+ .endif
+
.section ".note.gnu.property", "a"
.p2align ALIGN
.long 1f - 0f /* name length. */
@@ -24,14 +25,14 @@
.long 0xc0010002 /* pr_type. */
.long 5f - 4f /* pr_datasz. */
4:
- .long 0xa
+ .long 0xa /* GNU_PROPERTY_X86_ISA_1_V2 | GNU_PROPERTY_X86_ISA_1_V4 */
5:
.p2align ALIGN
/* GNU_PROPERTY_X86_ISA_1_NEEDED */
.long 0xc0008002 /* pr_type. */
.long 5f - 4f /* pr_datasz. */
4:
- .long 0x3
+ .long 0x3 /* GNU_PROPERTY_X86_ISA_1_BASELINE | GNU_PROPERTY_X86_ISA_1_V2 */
5:
.p2align ALIGN
3:
diff --git a/ld/testsuite/ld-x86-64/property-x86-2.S b/ld/testsuite/ld-x86-64/property-x86-2.s
similarity index 70%
rename from ld/testsuite/ld-x86-64/property-x86-2.S
rename to ld/testsuite/ld-x86-64/property-x86-2.s
index 613d5b21ce7..2c3b303f7ee 100644
--- a/ld/testsuite/ld-x86-64/property-x86-2.S
+++ b/ld/testsuite/ld-x86-64/property-x86-2.s
@@ -1,8 +1,9 @@
-#ifdef __LP64__
-# define ALIGN 3
-#else
-# define ALIGN 2
-#endif
+ .ifdef __64_bit__
+ .equ ALIGN, 3
+ .else
+ .equ ALIGN, 2
+ .endif
+
.section ".note.gnu.property", "a"
.p2align ALIGN
.long 1f - 0f /* name length. */
@@ -17,14 +18,14 @@
.long 0xc0010002 /* pr_type. */
.long 5f - 4f /* pr_datasz. */
4:
- .long 0x3
+ .long 0x3 /* GNU_PROPERTY_X86_ISA_1_BASELINE | GNU_PROPERTY_X86_ISA_1_V2 */
5:
.p2align ALIGN
/* GNU_PROPERTY_X86_ISA_1_NEEDED */
.long 0xc0008002 /* pr_type. */
.long 5f - 4f /* pr_datasz. */
4:
- .long 0xa
+ .long 0xa /* GNU_PROPERTY_X86_ISA_1_V2 | GNU_PROPERTY_X86_ISA_1_V4 */
5:
.p2align ALIGN
3:
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index 1a10c395b5c..123152df5b0 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -1091,86 +1091,6 @@ if { [isnative] && [check_compiler_available] } {
{{readelf {-n} property-2.r}} \
"property-2.so" \
] \
- [list \
- "Build property 3" \
- "" \
- "-Wa,-mx86-used-note=yes" \
- {pass.c property-stack.S property-x86-1.S} \
- {{readelf {-n} property-3.r}} \
- "property-3" \
- ] \
- [list \
- "Build property 3 (.o)" \
- "-r -nostdlib" \
- "-Wa,-mx86-used-note=yes" \
- {pass.c property-x86-1.S property-stack.S} \
- {{readelf {-n} property-3a.r}} \
- "property-3.o" \
- ] \
- [list \
- "Build property 3 (.so)" \
- "-shared" \
- "-fPIC -Wa,-mx86-used-note=yes" \
- {property-x86-1.S pass.c property-stack.S} \
- {{readelf {-n} property-3.r}} \
- "property-3.so" \
- ] \
- [list \
- "Build property 4" \
- "" \
- "-Wa,-mx86-used-note=yes" \
- {pass.c property-stack.S property-x86-1.S property-x86-2.S} \
- {{readelf {-n} property-4.r}} \
- "property-4" \
- ] \
- [list \
- "Build property 4 (.o)" \
- "-r -nostdlib" \
- "-Wa,-mx86-used-note=yes" \
- {pass.c property-x86-2.S property-x86-1.S property-stack.S} \
- {{readelf {-n} property-4a.r}} \
- "property-4.o" \
- ] \
- [list \
- "Build property 4 (.so)" \
- "-shared" \
- "-fPIC -Wa,-mx86-used-note=yes" \
- {property-x86-2.S property-x86-1.S pass.c property-stack.S} \
- {{readelf {-n} property-4.r}} \
- "property-4.so" \
- ] \
- [list \
- "Build property 4 (-Wl,-z,stack-size=0)" \
- "-Wl,-z,stack-size=0" \
- "-Wa,-mx86-used-note=yes" \
- {pass.c property-stack.S property-x86-1.S property-x86-2.S} \
- {{readelf {-n} property-4.r}} \
- "property-4" \
- ] \
- [list \
- "Build property 5" \
- "-Wl,-z,stack-size=0x900000" \
- "-Wa,-mx86-used-note=yes" \
- {pass.c property-stack.S property-x86-1.S property-x86-2.S} \
- {{readelf {-n} property-5.r}} \
- "property-5" \
- ] \
- [list \
- "Build property 5 (.o)" \
- "-r -nostdlib -Wl,-z,stack-size=0x900000" \
- "-Wa,-mx86-used-note=yes" \
- {pass.c property-x86-2.S property-x86-1.S property-stack.S} \
- {{readelf {-n} property-5a.r}} \
- "property-5.o" \
- ] \
- [list \
- "Build property 5 (.so)" \
- "-shared -Wl,-z,stack-size=0x900000" \
- "-fPIC -Wa,-mx86-used-note=yes" \
- {property-x86-2.S property-x86-1.S pass.c property-stack.S} \
- {{readelf {-n} property-5.r}} \
- "property-5.so" \
- ] \
[list \
"Build property-6.so" \
"-shared" \
@@ -2178,6 +2098,96 @@ run_ld_link_tests [list \
{{readelf -SW plt2.rd} {objdump -dwr plt2.dd}} \
"plt2" \
] \
+ [list \
+ "Build property 3" \
+ "" \
+ "" \
+ "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
+ {property-stk.s property-x86-1.s} \
+ {{readelf -n property-3.r}} \
+ "property-3" \
+ ] \
+ [list \
+ "Build property 3 (.o)" \
+ "-r -nostdlib" \
+ "" \
+ "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
+ {property-x86-1.s property-stk.s} \
+ {{readelf -n property-3a.r}} \
+ "property-3.o" \
+ ] \
+ [list \
+ "Build property 3 (.so)" \
+ "-shared" \
+ "" \
+ "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
+ {property-x86-1.s property-stk.s} \
+ {{readelf -n property-3.r}} \
+ "property-3.so" \
+ ] \
+ [list \
+ "Build property 4" \
+ "" \
+ "" \
+ "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
+ {property-stk.s property-x86-1.s property-x86-2.s} \
+ {{readelf -n property-4.r}} \
+ "property-4" \
+ ] \
+ [list \
+ "Build property 4 (.o)" \
+ "-r -nostdlib" \
+ "" \
+ "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
+ {property-x86-2.s property-x86-1.s property-stk.s} \
+ {{readelf {-n} property-4a.r}} \
+ "property-4.o" \
+ ] \
+ [list \
+ "Build property 4 (.so)" \
+ "-shared" \
+ "" \
+ "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
+ {property-x86-2.s property-x86-1.s property-stk.s} \
+ {{readelf -n property-4.r}} \
+ "property-4.so" \
+ ] \
+ [list \
+ "Build property 4 (-z stack-size=0)" \
+ "-z stack-size=0" \
+ "" \
+ "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
+ {property-stk.s property-x86-1.s property-x86-2.s} \
+ {{readelf -n property-4.r}} \
+ "property-4" \
+ ] \
+ [list \
+ "Build property 5" \
+ "-z stack-size=0x900000" \
+ "" \
+ "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
+ {property-stk.s property-x86-1.s property-x86-2.s} \
+ {{readelf -n property-5.r}} \
+ "property-5" \
+ ] \
+ [list \
+ "Build property 5 (.o)" \
+ "-r -nostdlib -z stack-size=0x900000" \
+ "" \
+ "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
+ {property-x86-2.s property-x86-1.s property-stk.s} \
+ {{readelf {-n} property-5a.r}} \
+ "property-5.o" \
+ ] \
+ [list \
+ "Build property 5 (.so)" \
+ "-shared -z stack-size=0x900000" \
+ "" \
+ "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
+ {property-x86-2.s property-x86-1.s property-stk.s} \
+ {{readelf -n property-5.r}} \
+ "property-5.so" \
+ ] \
[list \
"Build pr21626.so" \
"-shared -melf_x86_64" \
--
2.43.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [2.41 PATCH 09/10] Fix ld/x86: reduce testsuite dependency on system object files
2023-12-16 4:01 [2.41 PATCH 00/10] Misc binutils-2.41 test fixes Sam James
` (7 preceding siblings ...)
2023-12-16 4:01 ` [2.41 PATCH 08/10] ld/x86: reduce testsuite dependency on system object files Sam James
@ 2023-12-16 4:01 ` Sam James
2023-12-16 4:01 ` [2.41 PATCH 10/10] Fix 30808 gprofng tests failed Sam James
2023-12-20 10:59 ` [2.41 PATCH 00/10] Misc binutils-2.41 test fixes Sam James
10 siblings, 0 replies; 12+ messages in thread
From: Sam James @ 2023-12-16 4:01 UTC (permalink / raw)
To: binutils; +Cc: nickc, H.J. Lu
From: "H.J. Lu" <hjl.tools@gmail.com>
commit eab996435fe65a421541f59557c5f1fd427573a3
Author: Jan Beulich <jbeulich@suse.com>
Date: Tue Nov 7 13:58:32 2023 +0100
ld/x86: reduce testsuite dependency on system object files
changed some C compiler tests to assembler/linker tests which introduced
2 problems:
1. It broke x32 binutils tests since --64 was passed to assembler, but
-m elf_x86_64 wasn't passed to linker.
2. -nostdlib was passed to C compiler driver to exclude standard run-time
files which should be avoided with -r option for linker tests.
Fix them by passing -m elf_x86_64 to linker and removing -nostdlib for
linker tests with -r.
PR ld/30722
* testsuite/ld-x86-64/x86-64.exp: Pass -m elf_x86_64 to linker
for tests with --64. Remove -nostdlib for tests with -r.
(cherry picked from commit 260aa570edcf120332daefb4a102a08c90e4d9b4)
---
ld/testsuite/ld-x86-64/x86-64.exp | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index 123152df5b0..bc736696cd0 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -2100,7 +2100,7 @@ run_ld_link_tests [list \
] \
[list \
"Build property 3" \
- "" \
+ "-m elf_x86_64" \
"" \
"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
{property-stk.s property-x86-1.s} \
@@ -2109,7 +2109,7 @@ run_ld_link_tests [list \
] \
[list \
"Build property 3 (.o)" \
- "-r -nostdlib" \
+ "-m elf_x86_64 -r" \
"" \
"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
{property-x86-1.s property-stk.s} \
@@ -2118,7 +2118,7 @@ run_ld_link_tests [list \
] \
[list \
"Build property 3 (.so)" \
- "-shared" \
+ "-m elf_x86_64 -shared" \
"" \
"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
{property-x86-1.s property-stk.s} \
@@ -2127,7 +2127,7 @@ run_ld_link_tests [list \
] \
[list \
"Build property 4" \
- "" \
+ "-m elf_x86_64" \
"" \
"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
{property-stk.s property-x86-1.s property-x86-2.s} \
@@ -2136,7 +2136,7 @@ run_ld_link_tests [list \
] \
[list \
"Build property 4 (.o)" \
- "-r -nostdlib" \
+ "-m elf_x86_64 -r" \
"" \
"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
{property-x86-2.s property-x86-1.s property-stk.s} \
@@ -2145,7 +2145,7 @@ run_ld_link_tests [list \
] \
[list \
"Build property 4 (.so)" \
- "-shared" \
+ "-m elf_x86_64 -shared" \
"" \
"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
{property-x86-2.s property-x86-1.s property-stk.s} \
@@ -2154,7 +2154,7 @@ run_ld_link_tests [list \
] \
[list \
"Build property 4 (-z stack-size=0)" \
- "-z stack-size=0" \
+ "-m elf_x86_64 -z stack-size=0" \
"" \
"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
{property-stk.s property-x86-1.s property-x86-2.s} \
@@ -2163,7 +2163,7 @@ run_ld_link_tests [list \
] \
[list \
"Build property 5" \
- "-z stack-size=0x900000" \
+ "-m elf_x86_64 -z stack-size=0x900000" \
"" \
"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
{property-stk.s property-x86-1.s property-x86-2.s} \
@@ -2172,7 +2172,7 @@ run_ld_link_tests [list \
] \
[list \
"Build property 5 (.o)" \
- "-r -nostdlib -z stack-size=0x900000" \
+ "-m elf_x86_64 -r -z stack-size=0x900000" \
"" \
"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
{property-x86-2.s property-x86-1.s property-stk.s} \
@@ -2181,7 +2181,7 @@ run_ld_link_tests [list \
] \
[list \
"Build property 5 (.so)" \
- "-shared -z stack-size=0x900000" \
+ "-m elf_x86_64 -shared -z stack-size=0x900000" \
"" \
"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
{property-x86-2.s property-x86-1.s property-stk.s} \
--
2.43.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [2.41 PATCH 10/10] Fix 30808 gprofng tests failed
2023-12-16 4:01 [2.41 PATCH 00/10] Misc binutils-2.41 test fixes Sam James
` (8 preceding siblings ...)
2023-12-16 4:01 ` [2.41 PATCH 09/10] Fix " Sam James
@ 2023-12-16 4:01 ` Sam James
2023-12-20 10:59 ` [2.41 PATCH 00/10] Misc binutils-2.41 test fixes Sam James
10 siblings, 0 replies; 12+ messages in thread
From: Sam James @ 2023-12-16 4:01 UTC (permalink / raw)
To: binutils; +Cc: nickc, Vladimir Mezentsev
From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
In gprofng testing, we need a tempory gprofng installation to resolve run-time
dependencies on libraries (libgprofng, libopcodes, libbfd, etc).
We set LD_LIBRARY_PATH and GPROFNG_SYSCONFDIR to find our libraries and
configuration file. These variables must be set for all gprofng tests.
Tested on aarch64 and x86_64 with and without --enable-shared and --target=<>.
gprofng/ChangeLog
2023-08-31 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
PR gprofng/30808
* testsuite/config/default.exp: Make a temporary install dir.
Set LD_LIBRARY_PATH, GPROFNG_SYSCONFDIR.
* testsuite/lib/Makefile.skel: Move LD_LIBRARY_PATH and
GPROFNG_SYSCONFDIR setting in testsuite/config/default.exp.
(cherry picked from commit a13e4c5c10d1a13d9128d033c9525810e876ac14)
---
gprofng/testsuite/config/default.exp | 20 ++++++++++++++------
gprofng/testsuite/lib/Makefile.skel | 5 -----
2 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/gprofng/testsuite/config/default.exp b/gprofng/testsuite/config/default.exp
index 1c862d54592..c4a6588bb64 100644
--- a/gprofng/testsuite/config/default.exp
+++ b/gprofng/testsuite/config/default.exp
@@ -32,17 +32,25 @@ if {![info exists CFLAGS]} {
set CFLAGS "-g -O2"
}
+remote_exec host "sh -c \"rm -rf tmpdir; mkdir -p tmpdir\""
if { "$CHECK_TARGET" == "check-install" } {
set ::env(GPROFNG) "$PREFIX/bin/gprofng"
} else {
- set ::env(GPROFNG) "$BUILDDIR/src/gprofng"
+ # Make a temporary install dir to run gprofng from, and point at it
+ remote_exec host "sh -c \"$MAKE -C .. install-gprofng MAKEFLAGS=program_transform_name= DESTDIR=$BUILDDIR/tmpdir/root\""
+ set ::env(GPROFNG) [exec find $BUILDDIR/tmpdir -type f -name gprofng -perm -u+x | head -1]
+
+ set x [exec find $BUILDDIR/tmpdir -type d -name gprofng | head -1]
+ set ::env(LD_LIBRARY_PATH) "$x:$x/.."
+
+ set x [exec find $BUILDDIR/tmpdir -type f -name gprofng.rc | head -1]
+ set ::env(GPROFNG_SYSCONFDIR) [exec dirname $x]
+
+ puts "### LD_LIBRARY_PATH: $env(LD_LIBRARY_PATH)"
+ puts "### GPROFNG_SYSCONFDIR: $env(GPROFNG_SYSCONFDIR)"
}
+puts "### GPROFNG: $env(GPROFNG)"
set TEST_TIMEOUT 300
-# Create directories where gprofng can find libraries and binaries:
-remote_exec host "sh -c \"rm -rf tmpdir; mkdir -p tmpdir\""
-remote_exec host "sh -c \"mkdir -p lib; rm -f lib/gprofng; ln -s ../libcollector/.libs lib/gprofng\""
-remote_exec host "sh -c \"rm -f bin; ln -s src bin\""
-
load_lib display-lib.exp
diff --git a/gprofng/testsuite/lib/Makefile.skel b/gprofng/testsuite/lib/Makefile.skel
index 5a30966c1cd..9ccc0340c10 100644
--- a/gprofng/testsuite/lib/Makefile.skel
+++ b/gprofng/testsuite/lib/Makefile.skel
@@ -39,11 +39,6 @@ DISPLAY = $(GPROFNG) display text
EXPERIMENT = test.er
DISPLAY_LOG = display.log
-export LD_LIBRARY_PATH := $(BUILDDIR)/src
-
-# Set GPROFNG_SYSCONFDIR to find out gprofng.rc:
-export GPROFNG_SYSCONFDIR := $(srcdir)/../../../src
-
.PHONY: all collect compare clobber clean
all: compare
--
2.43.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [2.41 PATCH 00/10] Misc binutils-2.41 test fixes
2023-12-16 4:01 [2.41 PATCH 00/10] Misc binutils-2.41 test fixes Sam James
` (9 preceding siblings ...)
2023-12-16 4:01 ` [2.41 PATCH 10/10] Fix 30808 gprofng tests failed Sam James
@ 2023-12-20 10:59 ` Sam James
10 siblings, 0 replies; 12+ messages in thread
From: Sam James @ 2023-12-20 10:59 UTC (permalink / raw)
To: Sam James; +Cc: binutils, nickc
Sam James <sam@gentoo.org> writes:
> I'll push these in a few days if no objections. All of these should be
> fine, as they're test-only, and they're needed to get the testsuite passing
> downstream.
>
> Thanks.
Pushed.
>
> H.J. Lu (2):
> ld: Build libpr23169a.so with -z lazy
> Fix ld/x86: reduce testsuite dependency on system object files
>
> Jan Beulich (1):
> ld/x86: reduce testsuite dependency on system object files
>
> Nick Clifton (1):
> Fix "--only-keep-debug for ELF relocatables" binutils test for
> compilers which add .debug_macro sections to object files.
>
> Sam James (4):
> ld: Fix relocatable.d XFAIL/notarget entry for hppa
> ld: Fix retain7a.d XFAIL/notarget entry for hppa
> ld: fix relocatable, retain7a target pattens for HPPA
> ld: ld-lib.exp: log failed dump.out contents for debugging
>
> Vladimir Mezentsev (2):
> gprofng: 30700 tmpdir/gp-collect-app_F test fails
> Fix 30808 gprofng tests failed
>
> binutils/testsuite/binutils-all/objcopy.exp | 7 +-
> gprofng/testsuite/config/default.exp | 20 ++-
> .../gprofng.display/gp-collect-app_F.exp | 4 +-
> gprofng/testsuite/lib/Makefile.skel | 5 -
> ld/testsuite/ld-elf/relocatable.d | 2 +-
> ld/testsuite/ld-elf/retain7a.d | 2 +-
> ld/testsuite/ld-ifunc/ifunc.exp | 4 +-
> ld/testsuite/ld-x86-64/property-stk.s | 25 +++
> .../{property-x86-1.S => property-x86-1.s} | 15 +-
> .../{property-x86-2.S => property-x86-2.s} | 15 +-
> ld/testsuite/ld-x86-64/x86-64.exp | 170 +++++++++---------
> ld/testsuite/lib/ld-lib.exp | 4 +-
> 12 files changed, 159 insertions(+), 114 deletions(-)
> create mode 100644 ld/testsuite/ld-x86-64/property-stk.s
> rename ld/testsuite/ld-x86-64/{property-x86-1.S => property-x86-1.s} (75%)
> rename ld/testsuite/ld-x86-64/{property-x86-2.S => property-x86-2.s} (70%)
^ permalink raw reply [flat|nested] 12+ messages in thread