mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-01 13:20:25 +00:00
[ELF] Ignore sections flagged with SHF_EXCLUDE
Differential revision: https://reviews.llvm.org/D24966 llvm-svn: 282568
This commit is contained in:
parent
3e06eafc20
commit
27be542cdf
@ -226,6 +226,11 @@ void elf::ObjectFile<ELFT>::initializeSections(
|
||||
if (Sections[I] == &InputSection<ELFT>::Discarded)
|
||||
continue;
|
||||
|
||||
if (Sec.sh_flags & SHF_EXCLUDE) {
|
||||
Sections[I] = &InputSection<ELFT>::Discarded;
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (Sec.sh_type) {
|
||||
case SHT_GROUP:
|
||||
Sections[I] = &InputSection<ELFT>::Discarded;
|
||||
|
12
lld/test/ELF/exclude.s
Normal file
12
lld/test/ELF/exclude.s
Normal file
@ -0,0 +1,12 @@
|
||||
# REQUIRES: x86
|
||||
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
|
||||
# RUN: ld.lld -o %t1 %t
|
||||
# RUN: llvm-objdump -section-headers %t1 | FileCheck %s
|
||||
# CHECK-NOT: .aaa
|
||||
|
||||
.globl _start
|
||||
_start:
|
||||
jmp _start
|
||||
|
||||
.section .aaa,"ae"
|
||||
.quad 0
|
Loading…
Reference in New Issue
Block a user