llvm-project/llvm/test/LTO/X86
Teresa Johnson d820447212 Perform symbol binding for .symver versioned symbols
Summary:
In a .symver assembler directive like:
.symver name, name2@@nodename
"name2@@nodename" should get the same symbol binding as "name".

While the ELF object writer is updating the symbol binding for .symver
aliases before emitting the object file, not doing so when the module
inline assembly is handled by the RecordStreamer is causing the wrong
behavior in *LTO mode.

E.g. when "name" is global, "name2@@nodename" must also be marked as
global. Otherwise, the symbol is skipped when iterating over the LTO
InputFile symbols (InputFile::Symbol::shouldSkip). So, for example,
when performing any *LTO via the gold-plugin, the versioned symbol
definition is not recorded by the plugin and passed back to the
linker. If the object was in an archive, and there were no other symbols
needed from that object, the object would not be included in the final
link and references to the versioned symbol are undefined.

The llvm-lto2 tests added will give an error about an unused symbol
resolution without the fix.

Reviewers: rafael, pcc

Reviewed By: pcc

Subscribers: mehdi_amini, llvm-commits

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

llvm-svn: 297332
2017-03-09 00:19:49 +00:00
..
Inputs Renumber testcase metadata nodes after r290153. 2016-12-22 00:45:21 +00:00
attrs.ll
bcsection.ll
cfi_endproc.ll IR: Introduce local_unnamed_addr attribute. 2016-06-14 21:01:22 +00:00
current-section.ll Restore "[ThinLTO] Prevent exporting of locals used/defined in module level asm" 2016-11-14 17:12:32 +00:00
diagnostic-handler-noexit.ll
diagnostic-handler-remarks-with-hotness.ll [LTO] Simplify this test quite a bit, @func2 is unused/unneeded. 2017-02-12 03:47:54 +00:00
diagnostic-handler-remarks.ll [tests] Be explicit about the files we want to remove. 2017-02-10 22:55:37 +00:00
disable-verify.ll Refactor the InternalizePass into a helper class, and expose it through a public free function (NFC) 2016-04-13 05:25:08 +00:00
invalid.ll Add writeonly IR attribute 2016-07-04 08:01:29 +00:00
keep-used-puts-during-instcombine.ll
linkonce_odr_func.ll IR: Introduce local_unnamed_addr attribute. 2016-06-14 21:01:22 +00:00
list-symbols.ll
lit.local.cfg
llvm-lto-output.ll
no-undefined-puts-when-implemented.ll [LTO] Reject modules without datalayout. 2016-12-14 21:57:04 +00:00
objc-detection-i386.ll Add a libLTO API to query a memory buffer and check if it contains ObjC categories 2016-07-11 23:10:18 +00:00
objc-detection.ll Add a libLTO API to query a memory buffer and check if it contains ObjC categories 2016-07-11 23:10:18 +00:00
parallel.ll
pr25919.ll
private-symbol.ll
remangle_intrinsics.ll Remangle intrinsics names when types are renamed 2016-06-24 15:10:29 +00:00
remangle_intrinsics_tbaa.ll Implement intrinsic mangling for literal struct types. 2017-02-15 23:16:20 +00:00
restore-externals.ll
runtime-library.ll
set-merged.ll Revert r265817 2016-04-08 18:15:37 +00:00
stdcall.ll LTO: Use the correct mangler function in LTOCodeGenerator::applyScopeRestrictions(). 2016-10-12 20:12:19 +00:00
strip-debug-info-no-call-loc.ll Add a testcase for r297072. 2017-03-07 02:49:57 +00:00
strip-debug-info.ll Allow the LTO code generator to strip invalid debug info from the input. 2016-05-09 19:57:15 +00:00
symver-asm.ll Perform symbol binding for .symver versioned symbols 2017-03-09 00:19:49 +00:00
symver-asm2.ll Perform symbol binding for .symver versioned symbols 2017-03-09 00:19:49 +00:00
triple-init.ll [LTO] Reject modules without datalayout. 2016-12-14 21:57:04 +00:00
type-mapping-bug.ll Renumber testcase metadata nodes after r290153. 2016-12-22 00:45:21 +00:00
unnamed.ll LTO: Don't bother trying to mangle unnamed globals, as they can't be preserved with MustPreserveSymbols. 2016-04-27 23:48:11 +00:00