aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-07-21Some experimental support with TLS relaxation for static linking.linaro-local/tls-experimentsPeter Smith
Not quite good enough yet as ifunc isn't working properly. Change-Id: I291d51647f0b1777615d8f7d19729777cad10764
2016-07-21[ELF] - Fixed 3 testases failtures on win32 configuration.George Rimar
Had 3 testcases failtures: ELF/eh-frame-merge.s ELF/gc-sections-eh.s ELF/gc-sections-lsda.s​ Problem was that OutputOff is size_t, which is 32 for this configuration and next condition never was checked correctly: if (PieceI->OutputOff == (uintX_t)-1) continue; git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276296 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21ELF/AMDGPU: Add support for R_AMDGPU_ABS32Konstantin Zhuravlyov
Differential Revision: https://reviews.llvm.org/D21654 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276295 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21[ELF] - Linkerscript: add InputSectionDescription command to LS parser.George Rimar
This adds InputSectionDescription command to represent the input section declaration. This leads to next cleanup: SectionRule removed. ScriptConfiguration::Sections mamber removed. LinkerScript<ELFT>::getOutputSection() removed. Differential revision: https://reviews.llvm.org/D22617 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276283 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21Delete SplitInputSection.Rafael Espindola
This opens the way for having a different Piece type for EhInputSection. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276275 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21Simplify symbol version handling.Rui Ueyama
r275711 for "speedng up symbol version handling" was committed by misunderstanding; the benchmark number was measured with a debug build. The number with a release build didn't actually change. This patch removes false optimizations added in that patch. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276267 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21Instantiate Interp output section only when needed.Rui Ueyama
This change simplifies interaction between Writer and the linker script because we can make needsInterpSection() a file-scope function. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276261 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21[ELF] Support FLAGS attribute in program header definitionEugene Leviant
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276260 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21[ELF] - Linkerscript: remove excessive ScriptConfiguration::Filler fieldGeorge Rimar
Previously OutputSectionCommand::Filler was introduced, but unused. Patch fixes that. Differential revision: https://reviews.llvm.org/D22615 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276253 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21[ELF] - Initial support of tree-style linker script implemented.George Rimar
Approach uses LLVM-style RTTI for representing the linker script commands in a form of tree for future simplification of parsing. Core idea and code sample belongs to Rui Ueyama. Differential revision: https://reviews.llvm.org/D22604 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276243 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21fix warning when generating sphinx doc.Etienne Bergeron
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276227 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20[MachO] Add a couple of missing braces.Davide Italiano
Differential Revision: https://reviews.llvm.org/D21979 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276213 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20[ELF][MIPS] Omit redundant arguments in the `getMipsEFlags` function. NFCSimon Atanasyan
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276176 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20Delete EhInputSection::getOffset.Rafael Espindola
We no longer need it for relocations in .eh_frame. The only relocations that point to .eh_frame are the ones trying to find the output .eh_frame. This actually fixes a bug in the symbol value code. It was not handling -1 as an indicator for a piece not being included in the output. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276175 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20[ELF][MIPS] Create PLT entry specific for MIPS ABI version R6Simon Atanasyan
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276173 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20[ELF][MIPS] Pick arch flag from the first input file.Simon Atanasyan
LLD still does not produce a correct combination of MIPS ELF flags if input files have different sets of ELF flags (i.e. EF_MIPS_ARCH_32 and EF_MIPS_ARCH_32R2). But now we do not stick to "R2" ABI version and can emit EF_MIPS_ARCH_32R6 for example. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276172 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20Function names should start with lowercase letters.Rui Ueyama
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276165 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20Return a vector from createPhdrs instead of return nothing.Rui Ueyama
This way is consistent with createSections. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276164 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20Replace parallel arrays with a StringSwitch.Rui Ueyama
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276163 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20Remove `else` after `break`.Rui Ueyama
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276162 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20Avoid use of uninitialized iterators.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276157 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20Add yet more explicit template instantiations. These were always neededChandler Carruth
but things happened to work on some platforms prior to r276133. This should be the complete set (I hope). git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276155 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20Create thunks before regular relocation scan.Rafael Espindola
We will need to do something like this to support range extension thunks since that process is iterative. Doing this also has the advantage that when doing the regular relocation scan the offset in the output section is known and we can just store that. This reduces the number of times we have to run getOffset and I think will allow a more specialized .eh_frame representation. By itself this is already a performance win. firefox master 7.295045737 patch 7.209466989 0.98826892235 chromium master 4.531254468 patch 4.509221804 0.995137623774 chromium fast master 1.836928973 patch 1.823805241 0.992855612714 the gold plugin master 0.379768791 patch 0.380043405 1.00072310839 clang master 0.642698284 patch 0.642215663 0.999249070657 llvm-as master 0.036665467 patch 0.036456225 0.994293213284 the gold plugin fsds master 0.40395817 patch 0.404384555 1.0010555177 clang fsds master 0.722045545 patch 0.720946135 0.998477367518 llvm-as fsds master 0.03292646 patch 0.032759965 0.994943428477 scylla master 3.427376378 patch 3.368316181 0.98276810292 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276146 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20Use iterators to avoid dereferencing end().Rafael Espindola
Thanks to George Rimar for finding the problem. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276144 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20Simplify output section ownership.Rui Ueyama
This patch simplifies output section management by making Factory class have ownership of sections that creates. Differential Revision: https://reviews.llvm.org/D22575 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276141 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20[ELF] - Refactor of LinkerScript<ELFT>::getPhdrIndicesForSectionGeorge Rimar
Previously it was harder to read and also has a error: command kind was not checked. Differential revision: https://reviews.llvm.org/D22574 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276137 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20[ELF] Attempt to fix FreeBSD build bot (no template instantiation for ↵Eugene Leviant
getOutputSectionName) git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276133 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20Removed trailing whitespaces. NFC.George Rimar
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276126 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20Initial support for the local dynamic model ARM TLS relocations:Peter Smith
- R_ARM_TLS_LDM32 - R_ARM_TLS_LDO32 The local dynamic implementation and tests follows the same model as the other ARM TLS models. The R_ARM_TLS_LDO32 is implemented as R_ABS expr type as the getVA() for a TLS symbol will return the offset from the start of the TLS block. Differential Revision https://reviews.llvm.org/D22563 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276123 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20[ELF] Create output sections in LinkerScript classEugene Leviant
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276121 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20[ELF] - Fixed integral constant overflow warning under MSVS 2015. NFC.George Rimar
Under MSVS 2015 I observed integral constant overflow warning when aggregate initialization was used to init the bit field. Patch fixes that. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276118 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20Avoid some binary searches.Rafael Espindola
In here we are iterating relocations in order, so we can do the same with the pieces of .eh_frame and avoid a binary search. The link times I got with this patch were: firefox master 7.22977811 patch 7.141041442 0.987726225252 chromium master 4.478966851 patch 4.506602207 1.00617002914 chromium fast master 1.894713371 patch 1.866446889 0.98508139414 the gold plugin master 0.386193907 patch 0.382374918 0.990111213743 clang master 0.654849589 patch 0.647899815 0.989387220949 llvm-as master 0.037212718 patch 0.036858172 0.990472450843 the gold plugin fsds master 0.410876711 patch 0.407418613 0.991583611562 clang fsds master 0.734623069 patch 0.728237526 0.991307728726 llvm-as fsds master 0.033446197 patch 0.03302833 0.987506292569 scylla master 3.38134402 patch 3.414188846 1.00971354166 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276108 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20Support for standard model ARM TLSPeter Smith
Add relocations and identification functions for the Initial Exec and Global Dynamic TLS model defined in Addenda to, and Errata in, the ABI for the ARM Architecture. ARM uses variant 1 of the thread local storage data structures as defined in ELF Handling for Thread-Local Storage. The "experimental" descriptor based model that can be selected in gcc, but not clang with -mtls-dialect=gnu2 is not supported. The relocations R_ARM_TLS_LE12 and R_ARM_TLS_IE12GP are not supported, I know of no ARM Toolchain that supports these relocations as they limit the size of the TLS block. No code relaxation is supported as the standard ARM TLS model puts the relocations on literal data. Support for the local dynamic model will come in a follow up patch. Differential Revision: https://reviews.llvm.org/D22462 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276095 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19Fix build with gcc 6.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275972 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19[ELF] Minimal PHDRS parser and section to segment assignment supportEugene Leviant
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275965 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19Reformat comment from 3 to 2 lines. NFC.George Rimar
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275961 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19Fixed comment. NFC.George Rimar
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275959 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18Delete dead code.Rafael Espindola
And make it easier to spot code going dead by using elf::. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275858 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18docs/conf.py: update version to 4.0Hans Wennborg
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275847 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18Trunk release notes are now for 4.0.0Hans Wennborg
The 3.9 release are on the 3.9 branch. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275845 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18Pass section by reference. NFC.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275803 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18Remove SymbolBody::PlaceholderKind.Rui Ueyama
In the last patch for --trace-symbol, I introduced a new symbol type PlaceholderKind and store it to SymVector storage. It made all code that iterates over SymVector to recognize and skip PlaceholderKind symbols. I found that that's annoying. In this patch, I removed PlaceholderKind and stop storing them to SymVector. Now the information whether a symbol is being watched by --trace-symbol is stored to the Symtab hash table. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275747 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18Iterate over SymVector instead of Symtab hash table.Rui Ueyama
SymVector contains all symbols, so we can iterate either Symtab or SymVector to visit all symbols. Iterating over SymVector makes the next change for --trace-symbol possible. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275746 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17Unbreak msan buildbot.Rui Ueyama
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275728 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17Remove dead code.Rui Ueyama
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275724 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17Implement almost-zero-cost --trace-symbol.Rui Ueyama
--trace-symbol is a command line option to watch a symbol. Previosly, we looked up a hash table for a new symbol if the option is given. Any code that looks up a hash table for each symbol is expensive because the linker handles a lot of symbols. In our design, we look up a hash table strictly only once for a symbol, so --trace-symbol was an exception. This patch improves efficiency of the option by merging the hash table into the symbol table. Instead of looking up a separate hash table with a string, this patch sets `Traced` flag to symbols specified by --trace-symbol. So, if you insert a symbol and get a symbol with `Traced` flag on, you know that you need to print out a log message for the symbol. This is nearly zero cost. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275716 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17Make Lazy's ctro protected because it shouldn't be instantiated directly.Rui Ueyama
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275715 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17Remove duplicate public specifier.Rui Ueyama
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275714 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17Print out file names for common symbols for --trace-symbol.Rui Ueyama
Previously, there was no way to get a file name for a DefinedCommon symbol. This patch adds it. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275712 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17Handle versioned symbols efficiently.Rui Ueyama
Versions can be assigned to symbols in two different ways. One is the usual version scripts, and the other is special symbol suffix '@'. If a symbol contains '@', the string after that is considered to specify a version name. Previously, we look for '@' for all symbols. Anything that works on every symbol can be expensive because the linker has to handle a lot of symbols. The search for '@' was not an exception. In this patch, I made two optimizations. The first optimization is to handle '@' only when at least one version is defined. If no versions are defined, no versions can be assigned to any symbols, so it's waste of time to search for '@'. The second optimization is to scan only suffixes of symbol names instead of entire symbol names. Symbol names can be very long, but symbol versions are usually short, so scanning entire symbol names is waste of time, too. There are some error cases which we no longer be able to detect with this patch. I don't think it's a major drawback because they are minor errors. Speed is more important. This change improves LLD with debug info self-link time from 6.6993 seconds to 6.3426 seconds (or -5.3%). Differential Revision: https://reviews.llvm.org/D22433 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275711 91177308-0d34-0410-b5e6-96231b3b80d8