]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gold: Force a PC-relative reference to .LC0
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 23 Aug 2024 23:02:29 +0000 (16:02 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 28 Aug 2024 12:51:58 +0000 (05:51 -0700)
Force a PC-relative reference to .LC0 with:

__asm__ (".dc.a .LC0 - .");

for all targets.

Tested on x86, powerpc64le and aarch64.

* testsuite/discard_locals_relocatable_test.c: Force a PC-relative
reference to .LC0.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
gold/testsuite/discard_locals_relocatable_test.c

index 0b36069a1d9636537d389ac95545125c05fc769d..98691e9680a003c18401173f2fd2ccae13a6c04e 100644 (file)
    in the output object file. */
 __asm__ (".Lshould_be_discarded:");
 
-#ifdef __powerpc__
 /* Test wants to keep one local.  Satisfy it.  */
-#ifdef __powerpc64__
-__asm__ (".reloc 0,R_PPC64_NONE,.LC0");
-#else
-__asm__ (".reloc 0,R_PPC_NONE,.LC0");
-#endif
-#endif
+__asm__ (".dc.a .LC0 - .");
 
 extern void print_func (const char* s);