]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld: Use 0x10000 as absolute symbol value in PR ld/25754 tests
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 18 Jun 2026 11:57:20 +0000 (19:57 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 18 Jun 2026 23:22:06 +0000 (07:22 +0800)
PR ld/25754 tests verify that relocations against absolute symbol are
properly handled, using 42 as the absolute symbol value.  But GCC 17
treats 42 as the impossible symbol address, which is the absolute symbol
value and optimize out the symbol address check:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125869

Use 0x10000, instead of 42, as absolute symbol value to work with GCC 17.

PR ld/34298
* testsuite/ld-elf/pr25754-1a.c (main): Check against 0x10000
instead of 42.
* testsuite/ld-elf/pr25754-1b.s (bar): Replace 42 with 0x10000.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
ld/testsuite/ld-elf/pr25754-1a.c
ld/testsuite/ld-elf/pr25754-1b.s

index bc65c174d055f18334765909cd16f68de1079ec7..30b7195cbb31f9595d0494b5f0652c9e8ce3eafd 100644 (file)
@@ -13,7 +13,7 @@ get_bar (void)
 int
 main ()
 {
-  if ((uintptr_t) get_bar () == 42)
+  if ((uintptr_t) get_bar () == 0x10000)
     printf ("PASS\n");
   return 0;
 }
index 99d585d6b5f40847b66fb626539d4b2767fe7464..1babb39d49caa05ef720119cfbcb5c9744055a1c 100644 (file)
@@ -1,3 +1,3 @@
        .data
        .global bar
-       bar = 42
+       bar = 0x10000