summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Config.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Rename SymbolVersions VersionDefinitions.Rui Ueyama2016-07-161-1/+1
| | | | | | SymbolVersions sounds like it had versions for a symbol, so rename it. llvm-svn: 275674
* Rename Version VersionDefinition.Rui Ueyama2016-07-161-3/+3
| | | | | | | | | | | The identifier `Version` was used too often in the code to handle symbol versions. The struct that contains version definitions is named `Version`. Local variables for version ID are named `Version`. Local varaible for version string are named `Version`. This patch give them different names. llvm-svn: 275673
* Simplify default symbol version management. NFC.Rui Ueyama2016-07-161-1/+1
| | | | llvm-svn: 275669
* Rename VAStart -> ImageBase. NFC.Rui Ueyama2016-07-131-1/+1
| | | | | | | | | | Config members are named after corresponding command line options. This patch renames VAStart ImageBase so that they are in line with --image-base. Differential Revision: http://reviews.llvm.org/D22277 llvm-svn: 275298
* Reverted r275257 "[ELF] - Implement extern "c++" version script tag"George Rimar2016-07-131-7/+2
| | | | | | | | It broke build bots: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/8204 http://lab.llvm.org:8011/builders/lld-x86_64-freebsd/builds/19432 llvm-svn: 275258
* [ELF] - Implement extern "c++" version script tagGeorge Rimar2016-07-131-2/+7
| | | | | | | | | | | Patch implements 'extern' version script tag. Currently only values in quotes(") are supported. Matching of externs is performed in the same pass as exact match of globals. Differential revision: http://reviews.llvm.org/D21930 llvm-svn: 275257
* [ELF] Support for setting the base addressPetr Hosek2016-07-121-0/+1
| | | | | | | | The -image-base option allows for overriding the base address. Differential Revision: http://reviews.llvm.org/D22116 llvm-svn: 275206
* [ELF] - Add Id field to Version struct.George Rimar2016-07-121-1/+2
| | | | | | | | | | | That helps to avoid expressions like I + 2 in code that assigns version number to symbols. Change was suggested by Rui Ueyama. Differential revision: http://reviews.llvm.org/D22086 llvm-svn: 275159
* [ELF] - Do not error out when version declaration not found when building ↵George Rimar2016-07-081-0/+1
| | | | | | | | | | | | | | | | | executable. When building executable usually version script is absent. Before this patch error was shown in the case when symbol name contained version and there was no script to match it. Instead of error out patch allows to create new version declaration in this case and use it. gnu linkers do the same. That is PR28359. Differential revision: http://reviews.llvm.org/D21890 llvm-svn: 274828
* Do not call warning() from ELFOptTable::parse().Rui Ueyama2016-07-071-1/+1
| | | | | | | warning() depends on Config->FatalWarnings, so we don't want to call that function before we initialize that member. llvm-svn: 274723
* Fixed check-lld msan after r274504 "[ELF] - Implemented --fatal-warnings ↵George Rimar2016-07-041-1/+1
| | | | | | | | | | | | | option." Bot failed: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/14361/steps/check-lld%20msan/logs/stdio Fix: Initialize Config->FatalWarnings with false. As it might be used once a bit earlier than its initialization from command line arguments. llvm-svn: 274507
* [ELF] - Implemented --fatal-warnings option.George Rimar2016-07-041-0/+1
| | | | | | | | --fatal-warnings: Treat warnings as errors DIfferential revision: http://reviews.llvm.org/D21969 llvm-svn: 274504
* [ELF] - Depricate version references.George Rimar2016-07-011-1/+0
| | | | | | | | | | | | | | | | This is PR28358 According to https://www.akkadia.org/drepper/dsohowto.pdf "The fourth point, the VERS 1.0 version being referred to in the VERS 2.0 definition, is not really important in symbol versioning. It marks the predecessor relationship of the two versions and it is done to maintain the similar- ities with Solaris’ internal versioning. It does not cause any problem it might in fact be useful to a human reader so predecessors should always be mentioned." Patch partially reverts 273423 "[ELF] - Implemented version script hierarchies.", version references are just ignored now. Differential revision: http://reviews.llvm.org/D21888 llvm-svn: 274345
* [ELF] - Added support for --unresolved-symbols option.George Rimar2016-06-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Option has next description (http://linux.die.net/man/1/ld): "--unresolved-symbols=method Determine how to handle unresolved symbols. There are four possible values for method according to documentation: ignore-all: Do not report any unresolved symbols. report-all: Report all unresolved symbols. This is the default. ignore-in-object-files: Report unresolved symbols that are contained in shared libraries, but ignore them if they come from regular object files. ignore-in-shared-libs: Report unresolved symbols that come from regular object files, but ignore them if they come from shared libraries." Since report-all is default and we traditionally do not report about undefined symbols in lld, report-all does not report about undefines from DSO. ignore-in-object-files also does not do that. Handling of that option differs from what gnu linkers do. Option works in next way in lld: ignore-all: Do not report any unresolved symbols. report-all: Report all unresolved symbols except symbols from DSOs. This is the default. ignore-in-object-files: The same as ignore-all. gnore-in-shared-libs: The same as report-all. This is PR24524. Differential revision: http://reviews.llvm.org/D21794 llvm-svn: 274123
* [ELF] - Remove Config->ZDefs flag.George Rimar2016-06-281-1/+0
| | | | | | | | | -z defs is the same as --no-undefined (http://linux.die.net/man/1/ld). It looks to be a error to handle it separatelly. Differential revision: http://reviews.llvm.org/D21788 llvm-svn: 274003
* [ELF] - Implemented --no-undefined-version flagGeorge Rimar2016-06-281-0/+1
| | | | | | | | | | Option checks for cases where a version script explicitly lists a symbol, but the symbol is not defined and errors out such cases if any. Differential revision: http://reviews.llvm.org/D21745 llvm-svn: 273998
* Implement --trace-symbol=symbol option.Rui Ueyama2016-06-231-0/+2
| | | | | | | | | | | | | | | Patch by Shridhar Joshi. This option provides names of all the link time modules which define and reference symbols requested by user. This helps to speed up application development by detecting references causing undefined symbols. It also helps in detecting symbols being resolved to wrong (unintended) definitions in case of applications containing multiple definitions for same symbols with different types, bindings. Implements PR28226. llvm-svn: 273536
* [ELF] - Implemented version script hierarchies.George Rimar2016-06-221-0/+1
| | | | | | | | | | | | | | | | | | | | Patch implements hierarchies for version scripts. This allows to handle script files with dependencies, like next one has: LIBSAMPLE_1.0{ global: a; }; LIBSAMPLE_2.0 { global: b; }LIBSAMPLE_1.0; Differential revision: http://reviews.llvm.org/D21556 llvm-svn: 273423
* [ELF] - Recommit r273143("[ELF] - Basic versioned symbols support implemented.")George Rimar2016-06-201-0/+10
| | | | | | | | | | | | | | | | | | With fix: -soname flag was not set in testcase. Hash calculated for base def was different on local and bot machines because filename fos used for calculating. Initial commit message: Patch implements basic support of versioned symbols. There is no wildcards patterns matching except local: *; There is no support for hierarchies. There is no support for symbols overrides (@ vs @@ not handled). This patch allows programs that using simple scripts to link and run. Differential revision: http://reviews.llvm.org/D21018 llvm-svn: 273152
* Revert r273143 "[ELF] - Basic versioned symbols support implemented."George Rimar2016-06-201-10/+0
| | | | | | | It broke buildbot: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast llvm-svn: 273146
* [ELF] - Basic versioned symbols support implemented.George Rimar2016-06-201-0/+10
| | | | | | | | | | | | | Patch implements basic support of versioned symbols. There is no wildcards patterns matching except local: *; There is no support for hierarchies. There is no support for symbols overrides (@ vs @@ not handled). This patch allows programs that using simple scripts to link and run. Differential revision: http://reviews.llvm.org/D21018 llvm-svn: 273143
* Make local: optional.Rafael Espindola2016-06-171-1/+1
| | | | | | | | | | Doing that in an anonymous version is a bit silly, but this opens the way for supporting it in general. Since we don't support actual versions, for now we just disable the version script if we detect that it is missing a local. llvm-svn: 273000
* [LTO] Add --lto-aa-pipeline.Davide Italiano2016-06-021-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D20888 llvm-svn: 271605
* [LTO] Add the ability to specify a subset of passes to run.Davide Italiano2016-05-151-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D20267 llvm-svn: 269605
* Reorganize the cpio archiver as CpioFile class. NFC.Rui Ueyama2016-05-151-1/+0
| | | | | | This code separates the code to create cpio archive from the driver. llvm-svn: 269593
* Support --build-id=0x<hexstring>.Rui Ueyama2016-05-131-1/+2
| | | | | | | | If you specify the option in the form of --build-id=0x<hexstring>, that hexstring is set as a build ID. We observed that the feature is actually in use in some builds, so we want this feature. llvm-svn: 269495
* [ELF] implemented -z defs optionGeorge Rimar2016-05-111-0/+1
| | | | | | | | | | | Just do not allow to link shared library if there are undefined symbols. This fixes PR27447 Differential revision: http://reviews.llvm.org/D20169 llvm-svn: 269183
* [ELF] - Implemented -z combrelocs/nocombreloc.George Rimar2016-05-101-0/+1
| | | | | | | | | | | | | | | | | This is the option which sorts relocs to optimize dynamic linker performance. -z combelocs is the default in gold, also it ignores -z nocombreloc, this patch do the same. Patch sorts relocations by symbols only and do not create any DT_REL[A]COUNT entries. That is different with what gold/bfd do. More information about option is here: http://www.airs.com/blog/archives/186 http://people.redhat.com/jakub/prelink.pdf, p.2 Differential revision: http://reviews.llvm.org/D19528 llvm-svn: 269066
* Do not call hasArg and getLastArg for the same option.Rui Ueyama2016-04-281-1/+1
| | | | llvm-svn: 267839
* [ELF] Introduce --reproduce flag.Davide Italiano2016-04-261-0/+1
| | | | | | | | | | --reproduce dumps the object files in a directory chosen (preserving the file system layout) and the linker invocation so that people can create an archive and upload for debugging. Differential Revision: http://reviews.llvm.org/D19494 llvm-svn: 267497
* LTO: Merge -lto-no-discard-value-names with -save-temps.Rui Ueyama2016-04-221-1/+0
| | | | | | | | | | This patch is to remove -lto-no-discard-value-names flag and instead to use -save-temps as we discussed in the post-commit review thread for r267020. Differential Revision: http://reviews.llvm.org/D19437 llvm-svn: 267230
* ELF: Implement basic support for --version-script.Peter Collingbourne2016-04-221-0/+2
| | | | | | | | | | | | | | | | | | | | This patch only implements support for version scripts of the form: { [ global: symbol1; symbol2; [...]; symbolN; ] local: *; }; No wildcards are supported, other than for the local entry. Symbol versioning is also not supported. It works by introducing a new Symbol flag which tracks whether a symbol appears in the global section of a version script. This patch also simplifies the logic in SymbolBody::isPreemptible(), and teaches it to handle the case where symbols with default visibility in DSOs do not appear in the dynamic symbol table because of a version script. Fixes PR27482. Differential Revision: http://reviews.llvm.org/D19430 llvm-svn: 267208
* [LTO] Discard names for Values that are not global.Davide Italiano2016-04-211-0/+1
| | | | | | | This is not on by default (but it might be in the future). The knob to enable the optimization is -lto-discard-value-names. llvm-svn: 266953
* [LTO] Implement parallel Codegen for LTO using splitCodeGen.Davide Italiano2016-04-151-0/+1
| | | | | | | | Parallelism level can be chosen using the new --lto-jobs=K option where K is the number of threads used for CodeGen. It currently defaults to 1. llvm-svn: 266484
* Store a Symbol for EntrySym.Rafael Espindola2016-04-151-2/+2
| | | | | | This makes it impossible to forget to call repl on the SymbolBody. llvm-svn: 266432
* ELF: Implement --dynamic-listAdhemerval Zanella2016-04-131-0/+1
| | | | | | | | | | | | | | | | | | | | | This patch implements the --dynamic-list option, which adds a list of global symbol that either should not be bounded by default definition when creating shared libraries, or add in dynamic symbol table in the case of creating executables. The patch modifies the ScriptParserBase class to use a list of Token instead of StringRef, which contains information if the token is a quoted or unquoted strings. It is used to use a faster search for exact match symbol name. The input file follow a similar format of linker script with some simplifications (it does not have scope or node names). It leads to a simplified parser define in DynamicList.{cpp,h}. Different from ld/gold neither glob pattern nor mangled names (extern 'C++') are currently supported. llvm-svn: 266227
* Simplify handling of mips gp* symbols.Rafael Espindola2016-04-111-2/+0
| | | | | | Give them values instead of computing it during relocation. llvm-svn: 265986
* ELF: Add --build-id=sha1 option.Rui Ueyama2016-04-071-5/+1
| | | | llvm-svn: 265748
* ELF: Implement --build-id=md5.Rui Ueyama2016-04-071-1/+7
| | | | | | | | | Previously, we supported only one hash function, FNV-1, so BuildIdSection directly handled hash computation. In this patch, I made BuildIdSection an abstract class and defined two subclasses, BuildIdFnv1 and BuildIdMd5. llvm-svn: 265737
* ELF: Add --strip-debug option.Rui Ueyama2016-04-071-0/+1
| | | | | | | If --strip-debug option is given, then all sections whose names start with ".debug" are removed from output. llvm-svn: 265722
* ELF: Add --no-gnu-unique option.Rui Ueyama2016-04-071-0/+1
| | | | | | | When the option is specified, then all STB_GNU_UNIQUE symbols are converted to STB_GLOBAL symbols. llvm-svn: 265717
* [LTO] Implement -disable-verify, which disables bitcode verification.Davide Italiano2016-04-031-0/+1
| | | | | | | | | | | | | | | So, there are some cases when the IR Linker produces a broken module (which doesn't pass the verifier) and we end up asserting inside the verifier. I think it's always a bug producing a module which does not pass the verifier but there are some cases in which people can live with the broken module (e.g. if only DebugInfo metadata are broken). The gold plugin has something similar. This commit is motivated by a situation I found in the wild. It seems that somebody else discovered it independently and reported in PR24923. llvm-svn: 265258
* Call cl::ParseCommandLineOptions from the driver.Sean Silva2016-04-021-1/+0
| | | | | | Thanks to Rui for the suggestion; this simplifies things. llvm-svn: 265213
* Fix MSVC build after r265206Sean Silva2016-04-021-1/+1
| | | | | | c:\b\slave\sanitizer-windows\llvm\tools\lld\elf\Config.h(94) : error C2797: 'lld::elf::Configuration::MLlvm': list initialization inside member initializer list or non-static data member initializer is not implemented llvm-svn: 265207
* PR27104: Add -mllvm optionSean Silva2016-04-021-0/+1
| | | | | | The argv[0] is based on the analogous thing in clang. llvm-svn: 265206
* Define a utility function to read -O and lto-O options.Rui Ueyama2016-03-311-2/+2
| | | | llvm-svn: 265056
* ELF: Add flag for controlling LTO optimization level.Peter Collingbourne2016-03-311-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D18667 llvm-svn: 265053
* [ELF, PR27091] - Implemented -t/--trace optionGeorge Rimar2016-03-291-0/+1
| | | | | | | | | | -t/--trace Print the names of the input files as ld processes them. This fixes https://llvm.org/bugs/show_bug.cgi?id=27091. Differential revision: http://reviews.llvm.org/D18517 llvm-svn: 264708
* [ELF] - -pie/--pic-executable option implementedGeorge Rimar2016-03-171-0/+2
| | | | | | | | | | | | | | | | | -pie --pic-executable Create a position independent executable. This is currently only supported on ELF platforms. Position independent executables are similar to shared libraries in that they are relocated by the dynamic linker to the virtual address the OS chooses for them (which can vary between invocations). Like normal dynamically linked executables they can be executed and symbols defined in the executable cannot be overridden by shared libraries. Differential revision: http://reviews.llvm.org/D18183 llvm-svn: 263693
* [ELF] implement --warn-common/--no-warn-commonGeorge Rimar2016-03-141-0/+1
| | | | | | | | | | | | | -warn-common Warn when a common symbol is combined with another common symbol or with a symbol definition. Unix linkers allow this somewhat sloppy practice, but linkers on some other operating systems do not. This option allows you to find potential problems from combining global symbols. Differential revision: http://reviews.llvm.org/D17998 llvm-svn: 263413
OpenPOWER on IntegriCloud