The CloudABI (removed from Clang Driver) change from https://reviews.llvm.org/D29982 does not make sense. GNU ld and gold don't create dynamic sections for a non-PIC static link when --export-dynamic is specified. Creating dynamic sections is harmful in this scenario because we would consider undefined weak symbols preemptible and generate GLOB_DAT relocations, breaking the expectation that non-PIC static links only contain IRELATIVE relocations. In addition, there are other options that export symbols (--export-dynamic-symbol, --dynamic-list, etc). It does not make sense to special case --export-dynamic.
32 lines
1.1 KiB
ArmAsm
32 lines
1.1 KiB
ArmAsm
# REQUIRES: x86
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
|
|
# RUN: ld.lld %t.o -o %t --export-dynamic
|
|
# RUN: llvm-readelf -r --dyn-syms --hex-dump=.data %t | \
|
|
# RUN: FileCheck %s --check-prefixes=NORELOC,COMMON
|
|
|
|
# NORELOC: There are no relocations in this file.
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64 %p/Inputs/dummy-shared.s -o %t1.o
|
|
# RUN: ld.lld %t1.o -shared -o %t1.so
|
|
# RUN: ld.lld %t.o -o %t %t1.so -pie
|
|
# RUN: llvm-readelf -r --dyn-syms --hex-dump=.data %t | \
|
|
# RUN: FileCheck %s --check-prefixes=RELOC,COMMON
|
|
|
|
# RELOC: Relocation section '.rela.dyn' at offset {{.*}} contains 1 entries:
|
|
# RELOC-NEXT: Offset Info Type Symbol's Value Symbol's Name + Addend
|
|
# RELOC-NEXT: {{.*}} 0000000100000001 R_X86_64_64 0000000000000000 foo + 0
|
|
|
|
# NORELOC-NOT: Symbol table '.dynsym'
|
|
# RELOC: Symbol table '.dynsym' contains 2 entries:
|
|
# RELOC-NEXT: Num: Value Size Type Bind Vis Ndx Name
|
|
# RELOC-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
|
|
# RELOC-NEXT: 1: 0000000000000000 0 NOTYPE WEAK DEFAULT UND foo
|
|
# COMMON: Hex dump of section '.data':
|
|
# COMMON-NEXT: {{.*}} 00000000 00000000
|
|
# COMMON-EMPTY:
|
|
|
|
.weak foo
|
|
|
|
.data
|
|
.dc.a foo
|