Files
clang-p2996/lld/test/ELF/relocatable-comment.s
Rafael Espindola d4372f783b Avoid a crash with -r and .comment.
We would create a MergeInputSection for the synthetic .comment and
crash trying to add it to a regular output section.

With this we just don't add the synthetic section with -r. That is
consistent with gold that doesn't create .note.gnu.gold-version with
-r.

llvm-svn: 286635
2016-11-11 21:36:25 +00:00

28 lines
726 B
ArmAsm

# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t1.o
# RUN: ld.lld -r %t1.o -o %t
# RUN: llvm-readobj -s -section-data %t | FileCheck %s
# CHECK: Name: .comment
# CHECK-NEXT: Type: SHT_PROGBITS
# CHECK-NEXT: Flags [
# CHECK-NEXT: SHF_MERGE
# CHECK-NEXT: SHF_STRINGS
# CHECK-NEXT: ]
# CHECK-NEXT: Address:
# CHECK-NEXT: Offset:
# CHECK-NEXT: Size: 7
# CHECK-NEXT: Link:
# CHECK-NEXT: Info:
# CHECK-NEXT: AddressAlignment: 1
# CHECK-NEXT: EntrySize: 1
# CHECK-NEXT: SectionData (
# CHECK-NEXT: 0000: 666F6F62 617200 |foobar.|
# CHECK-NEXT: )
# We used to crash creating a merge and non merge .comment sections.
.section .comment,"MS",@progbits,1
.asciz "foobar"