summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[ELF] Rename MergedSection to OutputSection."Shankar Easwaran2014-11-194-95/+102
| | | | | | | | | This reverts commit r222310. Not sure which commit is the cause of the failure on the darwin bot. Will need to revert my changes and commit one change at a time. llvm-svn: 222330
* Revert "[ELF] Create input and output section names"Shankar Easwaran2014-11-195-61/+26
| | | | | | | | This reverts commit r222311. Reverting because of failure in the darwin bot. llvm-svn: 222329
* Revert "[ELF] Fix creation of segments."Shankar Easwaran2014-11-191-15/+3
| | | | | | | | This reverts commit r222312. There looks to be an intermittent failure in the darwin buildbot. llvm-svn: 222326
* [Mips] Remove unnecessary debug logging codeSimon Atanasyan2014-11-191-43/+0
| | | | | | No functional changes llvm-svn: 222325
* [Mips] Configure PLT and LA25 entries in the corresponding constructorsSimon Atanasyan2014-11-191-24/+24
| | | | | | No functional changes. llvm-svn: 222324
* [Mips] Inline the configurePLTReference methodSimon Atanasyan2014-11-191-9/+2
| | | | | | No functional changes. llvm-svn: 222323
* [Mips] Remove redundant const_castSimon Atanasyan2014-11-191-1/+1
| | | | | | No functional changes. llvm-svn: 222322
* [Mips] Make the function return type constant pointerSimon Atanasyan2014-11-191-2/+2
| | | | | | No functional changes. llvm-svn: 222321
* [Mips] Move setup of LLD_R_MIPS_STO_PLT relocation to the getPLTEntry() routineSimon Atanasyan2014-11-191-20/+5
| | | | | | No functional changes. llvm-svn: 222320
* [ELF] Handle ctors/dtors sectionsShankar Easwaran2014-11-192-21/+4
| | | | | | | | Move functionality from MIPS target to DefaultLayout. No change in functionality. llvm-svn: 222313
* [ELF] Fix creation of segments.Shankar Easwaran2014-11-191-3/+15
| | | | | | | Linker was creating a separate output segment in some cases if input sections had huge alignments. This patch fixes the issue. llvm-svn: 222312
* [ELF] Create input and output section namesShankar Easwaran2014-11-196-28/+63
| | | | | | No change in functionality. llvm-svn: 222311
* [ELF] Rename MergedSection to OutputSection.Shankar Easwaran2014-11-194-102/+95
| | | | | | No change in functionality. llvm-svn: 222310
* [ELF] Sectionkey should also contain path.Shankar Easwaran2014-11-191-14/+18
| | | | | | No change in functionality. llvm-svn: 222309
* Silence inconsistent override warnings.Eric Christopher2014-11-141-3/+3
| | | | llvm-svn: 222021
* Follow-up to r221913. Fix some -Wcast-qual warning reasons.Simon Atanasyan2014-11-142-5/+6
| | | | llvm-svn: 221974
* [ELF] Dynamic section was not aligned properly.Shankar Easwaran2014-11-141-4/+14
| | | | | | | The dynamic section was not aligned properly. The alignment of the section is determined by the word size of the architecture. llvm-svn: 221972
* [ELF] Fix the fileoffset according to the ELF spec.Shankar Easwaran2014-11-131-1/+2
| | | | | | | | | With --no-align-segments, there is a bug that the fileoffset may not be congruent to virtual address modulo page alignment. This patch fixes the problem. llvm-svn: 221890
* [ELF] Add CodeModel attribute to the DefinedAtom classSimon Atanasyan2014-11-135-8/+98
| | | | | | | | | | | | | | | | | | | | | | MIPS ELF symbols might contain some additional MIPS-specific flags in the st_other field besides visibility ones. These flags indicate code properties like microMIPS / MIPS16 encoding, position independent code etc. We need to transfer the flags from input objects to the output linked file to write them into the symbol table, adjust symbols addresses etc. I add new attribute CodeModel to the DefinedAtom class to hold target specific flag and to get over YAML/Native format conversion barrier. Other architectures/targets can extend CodeModel enumeration by their own flags. MIPS specific part of this patch adds support for STO_MIPS_MICROMIPS flag. This flag marks microMIPS symbols. Such symbol should: a) Has STO_MIPS_MICROMIPS in the corresponding .symtab record. b) Has adjusted (odd) address in the corresponding .symtab and .dynsym records. llvm-svn: 221864
* [ELF] Fix segment alignment.Shankar Easwaran2014-11-131-4/+11
| | | | | | | | | The segment alignment for PT_LOAD segments is set to page size by default, but if any of the sections require an alignment more than the page size, the segment alignment property is set to the maximum alignment of the sections that are part of the segment. llvm-svn: 221862
* [ELF] Fix max-page-size option.Shankar Easwaran2014-11-131-2/+1
| | | | | | | | | | The user can use the max-page-size option and set the maximum page size. Dont check for maximum allowed values for page size, as its what the kernel is configured with. Fix the test as well. llvm-svn: 221858
* [ELF] Change order of section match.Shankar Easwaran2014-11-111-1/+1
| | | | | | Addressed comments from Sean silva. llvm-svn: 221650
* [Mips] Replace the redundant condition by assert callSimon Atanasyan2014-11-101-3/+3
| | | | | | No functional changes. llvm-svn: 221603
* [Mips] Do not read addends for relocations which do not use themSimon Atanasyan2014-11-102-11/+8
| | | | | | No functional changes. llvm-svn: 221602
* [ELF] Fix DT_INIT_ARRAY{SZ} and DT_FINI_ARRAY{SZ}Shankar Easwaran2014-11-101-4/+26
| | | | | | | | | | The dynamic table was creating the entry DT_FINI_ARRAY{SZ} even when there was no .fini_array section. The entries should be creating in the dynamic section only if there are sections .init_array/.fini_array in the output. Fixes the tests that checked for errroneous outputs. llvm-svn: 221588
* [ELF] Fix values of linker created dynamic variables.Shankar Easwaran2014-11-101-0/+3
| | | | | | | | The value of _DYNAMIC should be pointing at the start of the .dynamic segment. This was pointing to the end of the dynamic segment. Similarly the value of _GLOBAL_OFFSET_TABLE_ was not proper too. llvm-svn: 221587
* [ELF] .dynamic should have SHT_DYNAMIC flagShankar Easwaran2014-11-101-0/+5
| | | | llvm-svn: 221586
* [ELF] Support -z max-page-size optionShankar Easwaran2014-11-101-1/+2
| | | | | | | The GNU linker allows the user to change the page size by using the option -z max-page-size. llvm-svn: 221584
* [ELF] Remove unused variableShankar Easwaran2014-11-081-1/+0
| | | | llvm-svn: 221572
* [ELF] Support --no-align-segments.Shankar Easwaran2014-11-082-13/+23
| | | | | | | | | | | | | lld generates an ELF by adhering to the ELF spec by aligning vma/fileoffset to a page boundary, but this becomes an issue when dealing with large pages. This adds support so that lld generated executables adheres to the ELF spec with the rule vma % p_align = offset % p_align. This is supported by the flag --no-align-segments. This could be the default in few targets like X86_64 to save space on disk. llvm-svn: 221571
* [Mips] Do not hard-code the paired relocation typeSimon Atanasyan2014-11-071-11/+15
| | | | | | | | Request `getPairRelocation()` function to get paired relocation type. That allows us to look up another pairs like R_MICROMIPS_HI16/LO16 in the future. llvm-svn: 221539
* [ELF] Remove is64bits() and isLittlEndian().Shankar Easwaran2014-11-0711-45/+18
| | | | | | | | | | ELFLinkingContext had these two functions, which is really not needed since the Writer uses a llvm::object template composed of Endianness, Alignment, Is32bit/64bit. We could just use that and not duplicate functionality. No Change In Functionality. llvm-svn: 221523
* [Mips] Take into account that PIC code is inherently CPICSimon Atanasyan2014-11-061-2/+7
| | | | | | Follow-up to r221439. llvm-svn: 221442
* [Mips] Follow-up to r221439. Include header to fix build on Windows.Simon Atanasyan2014-11-061-0/+1
| | | | llvm-svn: 221440
* [Mips] Check ELF flags to prevent linking of incompatible filesSimon Atanasyan2014-11-069-29/+191
| | | | | | | | | | | | | | | | | 1. The path checks ELF header flags to prevent linking of incompatible files. For example we do not allow to link files with different ABI, -mnan flags, some combination of target CPU etc. 2. The patch merge ELF header flags from input object files to put their combination to the generated file. For example, if some input files have EF_MIPS_NOREORDER flag we need to put this flag to the output file header. I use the `parseFile()` (not `canParse()`) method because in case of recognition of incorrect input flags combination we should show detailed error message and stop the linking process and should not try to use another `Reader`. llvm-svn: 221439
* [ELF] Remove llvm::Twine usageShankar Easwaran2014-11-061-2/+2
| | | | llvm-svn: 221433
* [ELF] Remove includes that are not usedShankar Easwaran2014-11-061-2/+0
| | | | llvm-svn: 221430
* [ELF] Use llvm::TwineShankar Easwaran2014-11-061-6/+2
| | | | llvm-svn: 221428
* [ELF] Implement isLittleEndian for all architecturesShankar Easwaran2014-11-065-5/+16
| | | | llvm-svn: 221427
* [ELF] Use std::find_if insteadShankar Easwaran2014-11-062-20/+15
| | | | llvm-svn: 221426
* [ELF] Use getVisibility() function to access st_other fieldSimon Atanasyan2014-11-051-4/+4
| | | | | | | The st_other field can contains not only visibility flag so we should retrieve a visibility flag using a bit-mask. llvm-svn: 221397
* [ELF] Update TODOShankar Easwaran2014-11-041-2/+6
| | | | llvm-svn: 221235
* [ELF] Fix MSVC buildbot.Shankar Easwaran2014-11-041-3/+3
| | | | | | | | For some reason, MSVC doesnot like the style. Checking to make sure this fixes the problem with the build. llvm-svn: 221234
* [ELF] Fix program headers.Shankar Easwaran2014-11-047-210/+189
| | | | | | | | | The ELF writer creates a invalid binary for few cases with large filesize and memory size for segments. This patch addresses the functionality and updates the test. This patch also cleans up parts of the ELF writer for future enhancements to support Linker scripts. llvm-svn: 221233
* Fix warnings about missing override.Rafael Espindola2014-11-033-10/+6
| | | | llvm-svn: 221165
* Fix unicode chars into ascii in comment lines.NAKAMURA Takumi2014-10-271-1/+1
| | | | llvm-svn: 220668
* Remove #ifdef __FreeBSDRui Ueyama2014-10-271-4/+2
| | | | | | | r220665 makes configure or CMake to set HAVE_CXXABI_H on FreeBSD 10.0. We don't need this ugly ifdef condition anymore. llvm-svn: 220666
* Use __cxa_demangle on FreeBSD to fix buildbots.Rui Ueyama2014-10-211-1/+1
| | | | llvm-svn: 220326
* Assume cxxabi.h exists on FreeBSDRui Ueyama2014-10-211-1/+3
| | | | | | | HAVE_CXXABI_H is not defined on FreeBSD but the system actually has the header. CMake test fails because the header depends on size_t. llvm-svn: 220315
* [ELF] Remove duplicate code.Shankar Easwaran2014-10-2111-337/+122
| | | | | | | The base class ELFObjectReader/ELFDSOReader implement the canParse functionaity with this change. llvm-svn: 220261
OpenPOWER on IntegriCloud