Files
clang-p2996/llvm/test/tools/llvm-objcopy/ELF/Inputs/compress-debug-sections.yaml
Fangrui Song 122d368b2b [llvm-objcopy] --[de]compress-debug-sections: don't compress SHF_ALLOC sections, only decompress .debug sections
Simplify --[de]compress-debug-sections to make it easier to add custom section [de]compression.
Change the following two behaviors to match GNU objcopy.

* --compress-debug-sections compresses SHF_ALLOC sections while GNU
  doesn't.
* --decompress-debug-sections decompresses non-debug sections while GNU
  doesn't.

Pull Request: https://github.com/llvm/llvm-project/pull/84885
2024-03-13 10:13:21 -07:00

64 lines
1.9 KiB
YAML

--- !ELF
FileHeader:
Class: ELFCLASS[[BITS=64]]
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .debug_foo
Type: SHT_PROGBITS
Content: 0000000000000000
- Name: .notdebug_foo
Type: SHT_PROGBITS
Content: 0000000000000000
- Name: .rela.debug_foo
Type: SHT_RELA
Info: .debug_foo
Relocations:
- Offset: 0x1
Symbol: 1
Type: R_X86_64_32
- Offset: 0x2
Symbol: 2
Type: R_X86_64_32
## This section should not be involved in relocations.
- Name: .debug_bar
Type: SHT_PROGBITS
Content: 0000000000000000
- Name: .group
Type: SHT_GROUP
Link: .symtab
AddressAlign: 4
EntSize: 0x0000000000000004
Info: groupname
Members:
- SectionOrType: GRP_COMDAT
- SectionOrType: .text.in.group
- SectionOrType: .debug_in_group
- Name: .text.in.group
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
Content: '00'
- Name: .debug_in_group
Type: SHT_PROGBITS
Flags: [ SHF_GROUP ]
Content: '00'
- Name: .debug_alloc
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC ]
Content: 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f
Symbols:
- Type: STT_SECTION
Section: .debug_foo
Binding: STB_GLOBAL
- Type: STT_SECTION
Section: .notdebug_foo
Binding: STB_GLOBAL
- Name: .Linfo_string0
Section: .debug_bar
Binding: STB_GLOBAL
- Name: groupname
Section: .group
Binding: STB_GLOBAL
...