Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm-objcopy] Add -strip-non-alloc option to remove all non-allocate…
…d sections This change adds a new flag not present in GNU objcopy that we call --strip-non-alloc. Differential Revision: https://reviews.llvm.org/D39926 llvm-svn: 318168
- Loading branch information
1 parent
0b2f73f
commit d56725a
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# RUN: yaml2obj %s > %t | ||
# RUN: llvm-objcopy --strip-non-alloc %t %t2 | ||
# RUN: llvm-readobj -file-headers -sections %t2 | FileCheck %s | ||
|
||
!ELF | ||
FileHeader: | ||
Class: ELFCLASS64 | ||
Data: ELFDATA2LSB | ||
Type: ET_REL | ||
Machine: EM_X86_64 | ||
Sections: | ||
- Name: .bss | ||
Type: SHT_NOBITS | ||
Flags: [ SHF_ALLOC ] | ||
- Name: .text | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_ALLOC, SHF_EXECINSTR ] | ||
- Name: .blarg | ||
Type: SHT_PROGBITS | ||
Flags: [ ] | ||
|
||
# CHECK: SectionHeaderCount: 4 | ||
|
||
# CHECK: Name: .bss | ||
# CHECK: Name: .text | ||
# CHECK: Name: .shstrtab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters