diff options
author | Fangrui Song <i@maskray.me> | 2023-05-02 09:35:00 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2023-05-02 09:35:00 -0700 |
commit | 1408504564f2ecc6020eb1b2735d441b3292ea27 (patch) | |
tree | 6bba5d449647fda87fc4d7579c7298fd6eb26434 /lld/test | |
parent | 009c053e3f822d0df556c6b39f632e31594373de (diff) | |
download | llvm-1408504564f2ecc6020eb1b2735d441b3292ea27.tar.gz |
[ELF] Name MergeSyntheticSection using an input section instead of the output section
In a link map, the input section name gives more information. See the updated
merge-entsize.s for an example. The output file is unchanged.
Compiler generated input sections with the SHF_MERGE flag have names such as
.rodata.str1.1 and .rodata.cstN, and are not affected by -fdata-sections.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D149466
Diffstat (limited to 'lld/test')
-rw-r--r-- | lld/test/ELF/merge-entsize.s | 6 | ||||
-rw-r--r-- | lld/test/ELF/merge-string-align.s | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/lld/test/ELF/merge-entsize.s b/lld/test/ELF/merge-entsize.s index 080d71b32971..f45b334f6365 100644 --- a/lld/test/ELF/merge-entsize.s +++ b/lld/test/ELF/merge-entsize.s @@ -1,8 +1,12 @@ // REQUIRES: x86 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o -// RUN: ld.lld %t.o -o %t +// RUN: ld.lld %t.o -o %t -M | FileCheck %s --check-prefix=MAP // RUN: llvm-readobj -S %t | FileCheck %s +// MAP: .rodata{{$}} +// MAP-NEXT: <internal>:(.rodata.1) +// MAP-NEXT: <internal>:(.rodata.2) + .section .rodata.1,"aM",@progbits,1 .p2align 2 .byte 0x42 diff --git a/lld/test/ELF/merge-string-align.s b/lld/test/ELF/merge-string-align.s index 0098d95b23d3..661019dd9b5b 100644 --- a/lld/test/ELF/merge-string-align.s +++ b/lld/test/ELF/merge-string-align.s @@ -1,8 +1,13 @@ // REQUIRES: x86 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o -// RUN: ld.lld %t.o -o %t.so -shared +// RUN: ld.lld %t.o -o %t.so -shared -M | FileCheck %s --check-prefix=MAP // RUN: llvm-readobj -S --section-data %t.so | FileCheck %s +// MAP: .rodata{{$}} +// MAP-NEXT: <internal>:(.rodata.foo) +// MAP-NEXT: .rodata2 +// MAP-NEXT: <internal>:(.rodata2) + .section .rodata.foo,"aMS",@progbits,1 .align 16 .asciz "foo" |