diff options
author | 2022-01-19 23:47:41 +1030 | |
---|---|---|
committer | 2022-02-05 17:41:08 +1030 | |
commit | 9097ec6cc41330b510cf1fdbafad19c4a21a914c (patch) | |
tree | 03457b5df580730108fc1152402a7eba37f55502 | |
parent | objcopy --only-keep-debug (diff) | |
download | binutils-gdb-9097ec6cc41330b510cf1fdbafad19c4a21a914c.tar.gz binutils-gdb-9097ec6cc41330b510cf1fdbafad19c4a21a914c.tar.bz2 binutils-gdb-9097ec6cc41330b510cf1fdbafad19c4a21a914c.zip |
Update PowerPC64 symtocbase test
Using a symbol other than .TOC. with @tocbase is an extension to the
ABI. It is never valid to use a symbol without a definition in the
binary, and symbols on these expressions cannot be overridden. Make
this explicit by using ".hidden" in the testcase.
* testsuite/ld-powerpc/symtocbase-1.s: Align data. Make function
entry symbol hidden.
* testsuite/ld-powerpc/symtocbase-2.s: Likewise.
* testsuite/ld-powerpc/symtocbase.d: Adjust expected output.
(cherry picked from commit ef5684c2bdf4d4f9975650e3b7b8f9b0ff98abee)
-rw-r--r-- | ld/testsuite/ld-powerpc/symtocbase-1.s | 10 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/symtocbase-2.s | 10 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/symtocbase.d | 2 |
3 files changed, 15 insertions, 7 deletions
diff --git a/ld/testsuite/ld-powerpc/symtocbase-1.s b/ld/testsuite/ld-powerpc/symtocbase-1.s index ba6f073710c..5b6417bd0a7 100644 --- a/ld/testsuite/ld-powerpc/symtocbase-1.s +++ b/ld/testsuite/ld-powerpc/symtocbase-1.s @@ -1,18 +1,22 @@ -.section .toc,"aw",@progbits + .section .toc,"aw",@progbits .align 15 .globl x x: .quad .x,.x@tocbase,0 .LCi: .quad i .space 48 * 1024 -.data + + .data + .p2align 2 .globl i i: .long 0 .L1bases: .quad .TOC.@tocbase .quad .x@tocbase .quad .y@tocbase -.text + + .text .globl .x + .hidden .x .x: ld 9,.LCi@toc(2) blr diff --git a/ld/testsuite/ld-powerpc/symtocbase-2.s b/ld/testsuite/ld-powerpc/symtocbase-2.s index 1176cb8a9c5..01cba6a19e0 100644 --- a/ld/testsuite/ld-powerpc/symtocbase-2.s +++ b/ld/testsuite/ld-powerpc/symtocbase-2.s @@ -1,16 +1,20 @@ -.section .toc,"aw",@progbits + .section .toc,"aw",@progbits .align 15 .globl y y: .quad .y,.y@tocbase,0 .LCi: .quad i .space 48 * 1024 -.data + + .data + .p2align 3 .L2bases: .quad .TOC.@tocbase .quad .x@tocbase .quad .y@tocbase -.text + + .text .globl .y + .hidden .y .y: ld 9,.LCi@toc(2) blr diff --git a/ld/testsuite/ld-powerpc/symtocbase.d b/ld/testsuite/ld-powerpc/symtocbase.d index 118885faa72..ffad90dbc56 100644 --- a/ld/testsuite/ld-powerpc/symtocbase.d +++ b/ld/testsuite/ld-powerpc/symtocbase.d @@ -16,7 +16,7 @@ Disassembly of section \.data: .* \.long 0x28000 .* \.long 0x0 .* \.long 0x38000 -.* \.long 0x0 +#... .* \.long 0x38000 .* \.long 0x0 .* \.long 0x28000 |