hanchenye-llvm-project/lld/test/elf/X86_64/mergesimilarstrings.test

41 lines
1.2 KiB
Plaintext

# Check that relocations to section that contains strings is properly handled
# when merging strings is enabled.
#
# RUN: yaml2obj -format=elf %s > %t.o
# RUN: lld -flavor gnu -target x86_64 %t.o --noinhibit-exec -o %t1.out
# RUN: llvm-readobj -sections %t1.out | FileCheck %s
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
AddressAlign: 0x04
Content: 54889e5488d3d00000000e80000000088d3d00000000e800000000b8000000005dc3
- Name: .rela.text
Type: SHT_RELA
Link: .symtab
AddressAlign: 0x04
Info: .text
Relocations:
- Offset: 0x07
Symbol: .rodata
Type: R_X86_64_PC32
Addend: -4
- Name: .rodata
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_MERGE, SHF_STRINGS ]
AddressAlign: 0x01
Content: 48656c6c6f20576f726c6400576f726c6400
Symbols:
Global:
- Name: .rodata
Section: .rodata
#CHECK: Name: .rodata
#CHECK: Size: 18