Files
clang-p2996/lld/test/ELF/invalid/entsize.yaml
Fangrui Song 56decd982d [ELF] Allow invalid sh_size%sh_entsize!=0 for non-SHF_MERGE sections
Fixes https://bugs.llvm.org/show_bug.cgi?id=45370
Fixes https://github.com/Clozure/ccl/issues/273

.stab holds a table of 12-byte entries. GNU as before 2.35 incorrectly
sets sh_entsize(.stab) to 20 on 64-bit architectures:
https://sourceware.org/bugzilla/show_bug.cgi?id=25768

We should not emit the confusing error:
"SHF_MERGE section size (...) must be a multiple of sh_entsize (20)

Reviewed By: grimar, psmith

Differential Revision: https://reviews.llvm.org/D77368
2020-04-03 08:48:30 -07:00

18 lines
455 B
YAML

## Ignore invalid sh_entsize (sh_size%sh_entsize!=0) for non-SHF_MERGE sections.
## GNU as before 2.35 had such a bug for .stab
## https://sourceware.org/bugzilla/show_bug.cgi?id=25768
# RUN: yaml2obj %s -o %t.o
# RUN: ld.lld -e 0 --fatal-warnings %t.o -o /dev/null
!ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .stab
Type: SHT_PROGBITS
EntSize: 20
Size: 24