Skip to content

Instantly share code, notes, and snippets.

@jubnzv
Created June 18, 2020 04:40
Show Gist options
  • Save jubnzv/3d973bd79780d5e6162c6a0c4f15fdaa to your computer and use it in GitHub Desktop.
Save jubnzv/3d973bd79780d5e6162c6a0c4f15fdaa to your computer and use it in GitHub Desktop.
# This checks that tool will emit an error when trying to remove the symbol
# table when we have a group section linked with symtab.
# RUN: yaml2obj %s -o %t.o
# RUN: not llvm-objcopy -R .symtab %t.o %t1 2>&1 >/dev/null | FileCheck %s --check-prefix=ERR -DINPUT=%t.o
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .symtab
Type: SHT_SYMTAB
- Name: .grp
Type: SHT_GROUP
Link: .symtab
Members:
- SectionOrType: GRP_COMDAT
## ERR: error: '[[INPUT]]': symbol table '.symtab' cannot be removed because it is referenced by the group section '.grp'
# RUN: llvm-objcopy --allow-broken-links -R .symtab %t.o %t3
# RUN: llvm-readobj --sections %t3 | FileCheck %s --check-prefix=SECTIONS --implicit-check-not=.symtab
# SECTIONS: Name: .grp
# SECTIONS: Link
# SECTIONS-SAME: : 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment