llvm-project/llvm/test/Object
Teresa Johnson a83c3f7879 [LTO] Prevent dead stripping and internalization of symbols with sections
Summary:
ELF linkers generate __start_<secname> and __stop_<secname> symbols
when there is a value in a section <secname> where the name is a valid
C identifier.  If dead stripping determines that the values declared
in section <secname> are dead, and we then internalize (and delete)
such a symbol, programs that reference the corresponding start and end
section symbols will get undefined reference linking errors.

To fix this, add the section name to the IRSymtab entry when a symbol is
defined in a specific section. Then use this in the gold-plugin to mark
the symbol as external and visible from outside the summary when the
section name is a valid C identifier.

Reviewers: pcc

Subscribers: mehdi_amini, inglorion, eraman, llvm-commits

Differential Revision: https://reviews.llvm.org/D35639

llvm-svn: 309009
2017-07-25 19:42:32 +00:00
..
AArch64 [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
AMDGPU AMDGPU: Remove deprecated and unused elf definitions 2017-06-05 21:33:40 +00:00
ARM Reland r298901 with modifications (reverted in r298932) 2017-04-03 21:50:04 +00:00
Inputs [WebAssembly] Be consistent in generating trivial test input files 2017-07-10 20:43:26 +00:00
Lanai [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
Mips [yaml2obj] Missed updating a few test cases in r273915 2016-06-27 20:02:49 +00:00
X86 [LTO] Prevent dead stripping and internalization of symbols with sections 2017-07-25 19:42:32 +00:00
ar-create.test
ar-error.test
archive-delete.test
archive-error-tmp.txt
archive-extract-dir.test
archive-extract.test [llvm-ar] errors go on stderr and not on stdout. 2017-04-05 14:52:17 +00:00
archive-format.test Archives require a symbol table on Solaris, even if empty. 2017-03-14 19:57:13 +00:00
archive-long-index.test
archive-move.test
archive-pad.test Write to a temporary file in test instead of random file in the test directory. 2017-02-22 09:02:27 +00:00
archive-replace-pos.test
archive-symtab.test Add support for Darwin’s static library table of contents with 64-bit offsets to the archive members. 2016-06-17 22:16:06 +00:00
archive-thin-create.test llvm/test/Object/archive-thin-create.test: Make sure that %t is empty to stabilize the test. 2016-12-09 11:44:57 +00:00
archive-thin-paths.test Object: replace backslashes with slashes in embedded relative thin archive paths on Windows. 2016-11-15 21:36:35 +00:00
archive-thin-read.test Create thin archive in GNU format to fix test on OS X. 2016-03-31 23:07:50 +00:00
archive-toc.test Prefix path when displaying thin archives. 2016-12-04 06:52:30 +00:00
archive-update.test
check_binary_output.ll
coff-archive-short.test
coff-archive.test
coff-empty-drectve.test [COFF] Gracefully handle empty .drectve sections 2017-05-14 18:34:56 +00:00
coff-invalid.test
coff-weak-externals.test llvm-objdump: support dumping AUX records for weak externals 2016-05-26 01:45:12 +00:00
corrupt.test [ELF] Convert ELF.h to Expected<T>. 2016-11-16 05:10:28 +00:00
directory.ll
dllimport-globalref.ll
dllimport.ll
dyn-rel-relocation.test
dynamic-reloc.test Add a testcase that would have found the bug in r263971. 2016-03-21 21:09:38 +00:00
elf-reloc-no-sym.test
elf-unknown-type.test [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
invalid.test [llvm-readobj] Improve errors on invalid binary 2017-05-10 14:18:11 +00:00
kext.test
lit.local.cfg
macho-invalid.test Fix a typo in an error message for a check of invalid Mach-O files where 2017-02-07 21:20:44 +00:00
mangle-ir.ll
mri-addlib.test
mri-addmod.test
mri-crlf.test
mri1.test
mri2.test
mri3.test
mri4.test
mri5.test
multi-module.ll Object: Make IRObjectFile own multiple modules and enumerate symbols from all modules. 2016-12-13 20:20:17 +00:00
nm-archive.test Change llvm-objdump, llvm-nm and llvm-size when reporting an object file error 2016-05-17 17:10:12 +00:00
nm-darwin-m.test
nm-error.test
nm-irix6.test
nm-pe-image.test
nm-shared-object.test Object: Handle files without a dynamic symbol table. 2017-02-03 16:53:55 +00:00
nm-trivial-object.test [WebAssembly] Be consistent in generating trivial test input files 2017-07-10 20:43:26 +00:00
nm-universal-binary.test Add support for Darwin’s 64-bit universal files with 64-bit offsets and sizes for the objects. 2016-06-20 22:16:18 +00:00
nm-weak-global-macho.test
no-section-header-string-table.test
no-section-table.test [llvm-readobj] - Teach readobj to print DT_FILTER dynamic tag in human readable form. 2017-07-14 16:00:16 +00:00
obj2yaml-coff-long-file-symbol.test
obj2yaml-coff-long-section-name.test
obj2yaml-coff-section-aux-symbol.test
obj2yaml-coff-weak-external.test
obj2yaml-invalid-reloc.test [obj2yaml] Produce correct output for invalid relocations. 2017-01-26 23:12:53 +00:00
obj2yaml-sectiongroup.test [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
obj2yaml.test [WebAssembly] Be consistent in generating trivial test input files 2017-07-10 20:43:26 +00:00
objc-imageinfo-coff.ll test: fix hexagon build 2017-06-05 21:45:25 +00:00
objc-imageinfo-elf.ll test: fix hexagon build 2017-06-05 21:45:25 +00:00
objc-imageinfo-macho.ll test: fix hexagon build 2017-06-05 21:45:25 +00:00
objdump-export-list.test
objdump-file-header.test
objdump-no-sectionheaders.test
objdump-private-headers.test
objdump-reloc-shared.test Revert "[llvm-objdump] Printing relocations in executable and shared object files. This partially reverts r215844 by removing test objdump-reloc-shared.test which stated GNU objdump doesn't print relocations, it does." 2016-03-21 20:59:15 +00:00
objdump-relocations.test [WebAssembly] Be consistent in generating trivial test input files 2017-07-10 20:43:26 +00:00
objdump-section-content.test
objdump-sectionheaders.test
objdump-shndx.test
objdump-symbol-table.test
pr25877.test
readobj-absent.test
readobj-elf-versioning.test
readobj-shared-object.test [llvm-readobj] - Teach readobj to print DT_FILTER dynamic tag in human readable form. 2017-07-14 16:00:16 +00:00
readobj.test
relocation-executable.test
simple-archive.test
size-trivial-macho.test
stackmap-dump.test [Stackmap] Added callsite counts to emitted function information. 2016-09-14 20:22:03 +00:00
wasm-invalid-start.test [WebAssembly] Fix validation of start function 2017-05-09 17:51:38 +00:00
yaml2obj-coff-invalid-alignment.test [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
yaml2obj-coff-multi-doc.test [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
yaml2obj-elf-alignment.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
yaml2obj-elf-bits-endian.test [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
yaml2obj-elf-file-headers-with-e_flags.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
yaml2obj-elf-file-headers.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
yaml2obj-elf-multi-doc.test [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
yaml2obj-elf-rel-noref.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
yaml2obj-elf-rel.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
yaml2obj-elf-section-basic.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
yaml2obj-elf-section-invalid-size.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
yaml2obj-elf-symbol-LocalGlobalWeak.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
yaml2obj-elf-symbol-basic.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
yaml2obj-elf-symbol-visibility.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
yaml2obj-readobj.test