1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
llvm-mirror/test/tools
Jordan Rupprecht 5a2178fb57 [llvm-objcopy] Skip --localize-symbol for undefined symbols
Summary:
Include the symbol being defined in the list of requirements for using --localize-symbol.

This is used, for example, when someone is depending on two different projects that have the same (or close enough) method defined in each library, and using "-L sym" for a conflicting symbol in one of the libraries so that the definition from the other one is used. However, the library may have internal references to the symbol, which cause program crashes when those are used, i.e.:

```
$ cat foo.c
int foo() { return 5; }
$ cat bar.c
int foo();
int bar() { return 2 * foo(); }
$ cat foo2.c
int foo() { /* Safer implementation */ return 42; }
$ cat main.c
int bar();
int main() {
  __builtin_printf("bar = %d\n", bar());
  return 0;
}
$ ar rcs libfoo.a foo.o bar.o
$ ar rcs libfoo2.a foo2.o
# Picks the wrong foo() impl
$ clang main.o -lfoo -lfoo2 -L. -o main
# Picks the right foo() impl
$ objcopy -L foo libfoo.a && clang main.o -lfoo -lfoo2 -L. -o main
# Links somehow, but crashes at runtime
$ llvm-objcopy -L foo libfoo.a && clang main.o -lfoo -lfoo2 -L. -o main
```

Reviewers: jhenderson, alexshap, jakehehrlich, espindola

Subscribers: emaste, arichardson

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

llvm-svn: 352767
2019-01-31 16:45:16 +00:00
..
dsymutil [dsymutil] Upstream unobfuscation logic. 2019-01-07 23:27:25 +00:00
gold Remove irrelevant references to legacy git repositories from 2019-01-15 16:18:52 +00:00
llvm-ar [llvm-ar] Resubmit recursive thin archive test with fix for full path names and better error messages 2019-01-15 21:52:31 +00:00
llvm-cfi-verify [cfi-verify] Support cross-DSO 2018-08-24 15:21:58 +00:00
llvm-config [gn build] Commit change that should have been in r350410. 2019-01-04 17:26:05 +00:00
llvm-cov [llvm-cov] Add lcov tracefile export format. 2018-11-09 16:10:44 +00:00
llvm-cvtres [opt] Change the parameter of OptTable::PrintHelp from Name to Usage and don't append "[options] <inputs>" 2018-10-10 00:15:31 +00:00
llvm-cxxdump [llvm-cxxdump] Use error reporting helpers from support 2018-11-11 01:24:02 +00:00
llvm-cxxfilt Add test for demangling GNU ABI tags. 2018-03-22 22:04:32 +00:00
llvm-cxxmap Add flag to llvm-profdata to allow symbols in profile data to be remapped, and 2018-09-13 20:22:02 +00:00
llvm-diff llvm-diff: Fix crash on anonymous functions 2018-09-24 04:42:13 +00:00
llvm-dlltool [COFF] Adjust how we flag weak externals 2018-07-20 20:48:29 +00:00
llvm-dwarfdump llvm-dwarfdump: Skip address index info (and dump only the address, if found) when non-verbose dumping addrx forms 2018-12-24 06:52:31 +00:00
llvm-dwp [llvm-dwp] Clean up tests X86/*.test 2018-09-07 18:29:20 +00:00
llvm-elfabi [elfabi] Add support for reading dynamic symbols from binaries 2019-01-24 22:39:21 +00:00
llvm-exegesis [llvm-exegesis] Add throughput mode. 2019-01-30 16:02:20 +00:00
llvm-extract [hot-cold-split] Name split functions with ".cold" suffix 2018-10-24 18:53:47 +00:00
llvm-isel-fuzzer Revert r326710 "Fuzzer: remove temporary files after we're done with them." 2018-03-12 13:22:12 +00:00
llvm-lib Attempt to get test/tools/llvm-lib/help.test passing on sanitizer-x86_64-linux-fast 2018-07-14 11:33:33 +00:00
llvm-lit
llvm-lto [ThinLTO] Serialize WithGlobalValueDeadStripping index flag for distributed backends 2018-02-07 04:05:59 +00:00
llvm-lto2 [NewPM] teach -passes= to emit meaningful error messages 2018-10-17 10:36:23 +00:00
llvm-mc Replace unused output filenames with /dev/null in tests 2018-07-02 18:16:44 +00:00
llvm-mca [X86][Btver2] Improved latency/throughput model for scalar int-to-float conversions. 2019-01-29 16:47:27 +00:00
llvm-modextract
llvm-mt [llvm-mt] Use WithColor for printing errors. 2018-06-23 16:49:07 +00:00
llvm-nm Add lit config file to skip tests if WebAssembly target is not available. 2019-01-30 09:49:39 +00:00
llvm-objcopy [llvm-objcopy] Skip --localize-symbol for undefined symbols 2019-01-31 16:45:16 +00:00
llvm-objdump [llvm-objdump] - Update test after r352366. NFC. 2019-01-28 15:49:41 +00:00
llvm-opt-fuzzer [NewPM] teach -passes= to emit meaningful error messages 2018-10-17 10:36:23 +00:00
llvm-opt-report
llvm-pdbdump [NativePDB] Fix access to both old & new fpo data entries from dbi stream 2019-01-30 10:40:45 +00:00
llvm-profdata [llvm-profdata] add value-cutoff functionality in show command 2019-01-08 22:41:48 +00:00
llvm-rc [llvm-rc] Support '--' for delimiting options from input paths 2019-01-16 08:09:22 +00:00
llvm-readobj [llvm-readelf] Don't suppress static symbol table with --dyn-symbols + --symbols 2019-01-23 16:15:39 +00:00
llvm-size [llvm-size][libobject] Add explicit "inTextSegment" methods similar to "isText" section methods to calculate size correctly. 2018-12-13 19:40:12 +00:00
llvm-split
llvm-strings [llvm-strings] Fix whitespaces to match strings output. 2018-11-09 18:03:21 +00:00
llvm-symbolizer [llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#3) 2019-01-31 14:22:50 +00:00
llvm-xray/X86 [llvm-xray] Support for PIE 2018-12-14 01:37:56 +00:00
lto [LTO] Change test/tools/lto/no-bitcode.s requirement from arm to aarch64 2019-01-18 15:57:59 +00:00
obj2yaml [obj2yaml] - Dump the sh_entsize section field. 2019-01-28 15:05:10 +00:00
opt-viewer [opt-viewer] Add javascript to expand/hide full message for multiline remarks. 2019-01-25 17:48:31 +00:00
sancov
sanstats [cfi] Help sanstats to find binary if they are not at the original location 2018-11-26 21:48:55 +00:00
yaml2obj [ObjectYAML] [COFF] Support multiple symbols with the same name 2019-01-07 20:55:33 +00:00