- Jun 02, 2017
-
-
George Rimar authored
Spec says: (http://www.sco.com/developers/gabi/latest/ch4.sheader.html) sh_info This member holds extra information, whose interpretation depends on the section type. If the sh_flags field for this section header includes the attribute SHF_INFO_LINK, then this member represents a section header table index. SHF_INFO_LINK The sh_info field of this section header holds a section header table index. Since sh_info for SHT_REL[A] sections should contain the section header index of the section to which the relocation applies, this is consistent with spec to put this flag. Behavior matches both bfd and gold as well. Differential revision: https://reviews.llvm.org/D33763 llvm-svn: 304531
-
Rafael Espindola authored
This allows us to remove the PageAlign field. It will also allow moving fabricateDefaultCommands earlier. llvm-svn: 304513
-
Rafael Espindola authored
llvm-svn: 304511
-
- Jun 01, 2017
-
-
Zachary Turner authored
Object files have symbol records not aligned to any particular boundary (e.g. 1-byte aligned), while PDB files have symbol records padded to 4-byte aligned boundaries. Since they share the same reading / writing code, we have to provide an option to specify the alignment and propagate it up to the producer or consumer who knows what the alignment is supposed to be for the given container type. Added a test for this by modifying the existing PDB -> YAML -> PDB round-tripping code to round trip symbol records as well as types. Differential Revision: https://reviews.llvm.org/D33785 llvm-svn: 304484
-
Rafael Espindola authored
This removes a call to getCmd and allows us to move clearOutputSections earlier. llvm-svn: 304439
-
Rafael Espindola authored
This is probably the correct location for it: next to fabricateDefaultCommands. If we don't have a linker script, we fabricate one. If we have one, we patch it. llvm-svn: 304436
-
Rafael Espindola authored
Now it is as early as it can go: just before synchronize. We now have to move synchronize earlier too. llvm-svn: 304434
-
Rafael Espindola authored
I don't have a testcase in mind, but there is no reason to have the linker script out of sync during a -r link. llvm-svn: 304433
-
Rafael Espindola authored
Also needed to move clearOutputSections earlier. llvm-svn: 304420
-
Rafael Espindola authored
This is needed to move clearOutputSections earlier. llvm-svn: 304419
-
George Rimar authored
This is PR33243. R_GOTONLY_PC_FROM_END was not in a list of link time constant expressions and that was a result of confusiing messages like PR shows: /usr/bin/ld.lld: error: /usr/lib/go/src/runtime/alg.go:47: can't create dynamic relocation R_386_GOTPC against local symbol in readonly segment defined in /tmp/nice/go-link-597453838/go.o Though in reality we just should not have try to create a dynamic relocation for this case at all. Patch fixes the issue. Differential revision: https://reviews.llvm.org/D33717 llvm-svn: 304393
-
George Rimar authored
This is PR33239, previously we segfault on given testcase. Differential revision: https://reviews.llvm.org/D33713 llvm-svn: 304392
-
Rafael Espindola authored
We were looking up sections by name during expression evaluation. By keeping track of forward declarations we can do the lookup during script parsing. Doing the lookup earlier will be more efficient when assignAddresses is run twice and removes two uses of OutputSections. llvm-svn: 304381
-
Rafael Espindola authored
The sections are ordered, so we can just use the first one when looking for the lowest address. llvm-svn: 304369
-
Rafael Espindola authored
llvm-svn: 304368
-
- May 31, 2017
-
-
Rafael Espindola authored
Another step into merging the linker script and non linker script code paths. llvm-svn: 304339
-
Rafael Espindola authored
Before InputSectionBase had an OutputSection pointer, but that was not always valid. For example, if it was a merge section one actually had to look at MergeSec->OutSec. This was brittle and caused bugs like the one fixed by r304260. We now have a single Parent pointer that points to an OutputSection for InputSection, but to a SyntheticSection for merge sections and .eh_frame. This makes it impossible to accidentally access an invalid OutSec. llvm-svn: 304338
-
Rafael Espindola authored
llvm-svn: 304334
-
Rafael Espindola authored
llvm-svn: 304330
-
Rafael Espindola authored
llvm-svn: 304328
-
Rafael Espindola authored
We would crash if a SHF_LINK_ORDER section pointed to a non InputSection section. Since those sections are not merged in order, SHF_LINK_ORDER is pretty meaningless and we can error on that case. llvm-svn: 304327
-
Peter Smith authored
This change converts the writing of the .ARM.exidx sentinel section to use the InputSectionDescriptions instead of OutputSection::Sections this is in preparation for the retirement of OutputSection::Sections. Differential Revision: https://reviews.llvm.org/D33500 llvm-svn: 304289
-
Rafael Espindola authored
This happens when attempting to link shared libraries using exceptions on MIPS. It requires -z notext because clang generates R_MIPS_64 relocations inside .eh_frame. The crash happened because for EhInputSection the OutSec member is null. Patch by Alexander Richardson! llvm-svn: 304260
-
- May 30, 2017
-
-
Rafael Espindola authored
By the time we get here all live sections should have been combined into InputSections. llvm-svn: 304243
-
Rafael Espindola authored
llvm-svn: 304240
-
Peter Smith authored
When there is a linker script with .ARM.exidx in the SECTIONS command we must add the .ARM.exidx sentinel section to the InputSectionDescriptions as well as to OutputSection::Sections. Differential Revision: https://reviews.llvm.org/D33496 llvm-svn: 304206
-
George Rimar authored
llvm-svn: 304197
-
George Rimar authored
I found that during visual inspection of code while wrote different patch. Script in testcase probably have nothing common with real life, but we segfault currently using it. If output section is known NOBITS, there is no need to create writers threads for doing nothing or proccess any filler logic that is useless here. We can just early return, that is what this patch do. DIfferential revision: https://reviews.llvm.org/D33646 llvm-svn: 304192
-
Petr Hosek authored
InputSections may contain MergeInputSection members which trigger a segmentation fault when trying to cast them to InputSection. Differential Revision: https://reviews.llvm.org/D33628 llvm-svn: 304189
-
Petr Hosek authored
While the following expression is handled fine: PROVIDE_HIDDEN(newsym = oldsym + address); The following expression triggers an error because the expression is evaluated as absolute: PROVIDE_HIDDEN(newsym = ALIGN(oldsym, CONSTANT(MAXPAGESIZE)) + address); To avoid this error, we use late evaluation for ALIGN by making the alignment an attribute of the expression itself. Differential Revision: https://reviews.llvm.org/D33629 llvm-svn: 304185
-
Rafael Espindola authored
llvm-svn: 304182
-
Rafael Espindola authored
Now that we are trying to use the linker script representation as the canonycal one, there are a few loops looking for just OutputSectionCommands. Create a vector with just the OutputSectionCommands once that is stable to simplify the rest of the code. llvm-svn: 304181
-
- May 29, 2017
-
-
George Rimar authored
This is PR33052, "Bug 33052 - -r eats comdats ". To fix it I stop removing group section from out when -r is given and fixing SHT_GROUP content when writing it just like we do some other fixup, e.g. for Rel[a]. (it needs fix for section indices that are in group). Differential revision: https://reviews.llvm.org/D33485 llvm-svn: 304140
-
- May 26, 2017
-
-
Petr Hosek authored
The .dynamic section of an ELF almost doesn't need to be written to with the exception of the DT_DEBUG entry. For several reasons having a read only .dynamic section would be useful. This change adds the -z keyword "rodynamic" which forces .dynamic to be read-only. In this case DT_DEBUG will not be emited. Patch by Jake Ehrlich Differential Revision: https://reviews.llvm.org/D33251 llvm-svn: 304024
-
George Rimar authored
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/8549/steps/build_Lld/logs/stdio llvm-svn: 304016
-
Rafael Espindola authored
After fabricateDefaultCommands we can look at the script commands. llvm-svn: 304014
-
Rafael Espindola authored
This is a necessary step for moving clearOutputSections earlier. llvm-svn: 304009
-
Rafael Espindola authored
On SPARC, .plt is both writeable and executable. The current way sections are sorted means that lld puts it after .data/.bss. but it really needs to be close to .test to make sure branches into .plt don't overflow. I'd argue that because .bss is supposed to come last on all architectures, we should change the default sort order such that writable and executable sections come before sections that are just writeable. read-only executable sections should still come after sections that are just read-only of course. This diff makes this change. llvm-svn: 304008
-
George Rimar authored
Restore bitwise-or order and fix warning (was changed by mistake during resolve of conflicts). llvm-svn: 303976
-
George Rimar authored
I found this when builded llc binary using gcc 5.4.1 + LLD. gcc produces duplicate entries in .debug_gnu_pubtypes section, ex: UnifyFunctionExitNodes.cpp.o has: 0x0000ac07 EXTERNAL TYPE "std::success_type<void*>" 0x0000ac07 EXTERNAL TYPE "std::success_type<void*>" clang produces single entry here: 0x0000d291 EXTERNAL TYPE "std::__success_type<void *>" If we link output from gcc with LLD, that would produce excessive duplicate entries in .gdb_index constant pool area. That does not seem affect gdb work, but makes .gdb_index larger than it can be. I also checked that gold filters out such duplicates too. Patch fixes it. Differential revision: https://reviews.llvm.org/D32647 llvm-svn: 303975
-