| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
NFC, just makes it easier to access from non templated code.
llvm-svn: 309152
|
|
|
|
| |
llvm-svn: 308939
|
|
|
|
|
|
|
|
| |
it to segment headers correctly.
Differential Revision: https://reviews.llvm.org/D35813
llvm-svn: 308930
|
|
|
|
| |
llvm-svn: 308812
|
|
|
|
|
|
|
|
|
| |
This is PR33821.
What we really want to check in here is if the output section was
created, not if the command was empty.
llvm-svn: 308382
|
|
|
|
| |
llvm-svn: 308297
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I have a patch to let DwarfContext defer to lld for getting section
contents and relocations.
That is a pretty big performance improvement.
This is just a refactoring to make that easier to do.
This change makes the *creation* of gdb index a dedicated step and
makes that templated. That is so that we can uses Elf_Rel in the code.
llvm-svn: 307867
|
|
|
|
|
|
|
|
|
|
| |
In preparation for the addition of rangeThunks() calculate the addresses
of all the inputSections so that ThunkSections can be inserted at the right
place.
Differential Revision: https://reviews.llvm.org/D34688
llvm-svn: 307373
|
|
|
|
| |
llvm-svn: 307279
|
|
|
|
|
|
|
| |
It is now just after the OutputSections are created, which is as early
as it can possibly go.
llvm-svn: 307225
|
|
|
|
| |
llvm-svn: 307220
|
|
|
|
|
|
|
| |
This avoids having to compute relocation section sizes early, removing
the last use of assignOffsets.
llvm-svn: 307219
|
|
|
|
| |
llvm-svn: 307214
|
|
|
|
| |
llvm-svn: 307209
|
|
|
|
|
|
| |
This is a bit simpler and avoids a walk over OutputSections.
llvm-svn: 307178
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The allocateHeaders() function is called at the end of assignAddresses(), it
decides whether the ELF header and program header table can be allocated to
a PT_LOAD program header. As the function alters state, it prevents
assignAddresses() from being called multiple times.
This change splits out the call to allocateHeaders() from assignAddresses()
this will permit assignAddresses() to be called while processing range
extension thunks without trying to allocateHeaders().
Differential Revision: https://reviews.llvm.org/D34344
llvm-svn: 307131
|
|
|
|
|
|
|
|
|
|
| |
This is finally getting to the point where output sections are
constructed.
createOrphanCommands and fabricateDefaultCommands are moved out so
they can be merged with existing code in followup commits.
llvm-svn: 307107
|
|
|
|
|
|
| |
Now addSectionSymbols operates on the linker script.
llvm-svn: 307102
|
|
|
|
|
|
| |
Now all of finalizeSections works on the linker script.
llvm-svn: 307101
|
|
|
|
|
|
| |
Now addPredefinedSections operates only on the linker script.
llvm-svn: 307100
|
|
|
|
|
|
| |
Two more places.
llvm-svn: 307076
|
|
|
|
| |
llvm-svn: 307044
|
|
|
|
|
|
|
| |
Now removeUnusedSyntheticSections operates entirely on the linker
script.
llvm-svn: 307043
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Script commands are processed before unused synthetic sections are
removed. Therefore, if a linker script matches one of these sections
it'll get emitted as an empty output section because the logic for
removing unused synthetic sections ignores script commands which
could have already matched and captured one of these sections. This
patch fixes that by also removing the unused synthetic sections from
the script commands.
Differential Revision: https://reviews.llvm.org/D34800
llvm-svn: 307037
|
|
|
|
| |
llvm-svn: 306609
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and -r
This is PR33596. Previously LLD would crash
because BYTE command synthesized output section,
but it was not assigned to Sec member of OutputSectionCommand.
Behaviour of -script and -r combination is not well defined,
but it seems after this change LLD naturally inherits behavior of
GNU linkers - creates output section requested in script and does not
crash anymore.
Differential revision: https://reviews.llvm.org/D34676
llvm-svn: 306527
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When -ffunction-sections and ARM C++ exceptions are used each .text.suffix
section will have at least one .ARM.exidx.suffix section and may have an
additional .ARM.extab.suffix section if the unwinding instructions are too
large to inline into the .ARM.exidx table entry. For a large program without
a linker script this can lead to a large number of section header table
entries that can increase the size of the ELF file.
This change introduces a default rule for .ARM.extab.* to be placed in
a single output section called .ARM.extab . This follows the behavior of
ld.gold and ld.bfd.
fixes pr33407
Differential Revision: https://reviews.llvm.org/D34678
llvm-svn: 306522
|
|
|
|
|
|
|
|
| |
Most "reserved" symbols are in ElfSym and it looks like there's no
reason to not do the same thing for _GLOBAL_OFFSET_TABLE_. This should
help https://reviews.llvm.org/D34618 too.
llvm-svn: 306292
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On many architectures gcc and clang will recognize _GLOBAL_OFFSET_TABLE_ - .
and produce a relocation that can be processed without needing to know the
value of _GLOBAL_OFFSET_TABLE_. This is not always the case; for example ARM
gcc produces R_ARM_BASE_PREL but clang produces the more general
R_ARM_REL32 to _GLOBAL_OFFSET_TABLE_. To evaluate this relocation
correctly _GLOBAL_OFFSET_TABLE_ must be defined to be the either the base of
the GOT or end of the GOT dependent on architecture..
If/when llvm-mc is changed to recognize _GLOBAL_OFFSET_TABLE_ - . this
change will not be necessary for new objects. However there may still be
old objects and versions of clang.
Differential Revision: https://reviews.llvm.org/D34355
llvm-svn: 306282
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I found this while trying to build u-boot. It uses -Ttext in
combination with linker scripts.
My first reaction was to change the linker scripts to have the correct
value, but I found that it is actually quite convenient to have -Ttext
take precedence.
By having just
.text : { *(.text) }
In the script, they can define the text address in a single Makefile
and pass it to ld with -Ttext and for the C code with
-DFoo=value. Doing the same with linker scripts would require them to
be generated during the build.
llvm-svn: 305766
|
|
|
|
|
|
|
|
|
|
|
|
| |
In preparation for supporting range extension thunks we now continually
call createThunks() until no more thunks are added. This requires us to
record the thunks we add on each pass and only merge the new ones into the
OutputSection. We also need to check if a Relocation is targeting a thunk
to prevent us from infinitely creating more thunks.
Differential Revision: https://reviews.llvm.org/D34034
llvm-svn: 305555
|
|
|
|
| |
llvm-svn: 305514
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is probably the main patch left in unifying our intermediary
representation.
It moves the creation of default commands before section sorting. This
has the nice effect that we now have one location where we decide
where an orphan section should be placed.
Before this patch sortSections would decide the relative location of
orphan sections to other sections, but it was up to placeOrphanSection
to decide on the exact location.
We now only sort sections we created since the linker script is
already in the correct order.
llvm-svn: 305512
|
|
|
|
|
|
|
| |
This is similar to what we do for InputSections and makes them easier
to access.
llvm-svn: 305337
|
|
|
|
| |
llvm-svn: 305333
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D34093
llvm-svn: 305176
|
|
|
|
| |
llvm-svn: 305156
|
|
|
|
|
|
| |
This then requires delaying a call to getHeaderSize.
llvm-svn: 304961
|
|
|
|
|
|
| |
This allows moving clearOutputSections earlier.
llvm-svn: 304952
|
|
|
|
|
|
|
| |
The real offsets are computed in assignAddresses and we compute the
special cases we need earlier after this.
llvm-svn: 304950
|
|
|
|
| |
llvm-svn: 304948
|
|
|
|
|
|
| |
This allows moving clearOutputSections a bit earlier.
llvm-svn: 304947
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Thunks are now generated per InputSectionDescription instead of per
OutputSection. This allows created ThunkSections to be inserted directly
into InputSectionDescription.
Changes in this patch:
- Loop over InputSectionDescriptions to find relocations to Thunks
- Generate a ThunkSection per InputSectionDescription
- Remove synchronize() as we no longer need it
- Move fabricateDefaultCommands() before createThunks
Differential Revision: https://reviews.llvm.org/D33835
llvm-svn: 304887
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we would merge relocation sections by name.
That did not work in some cases, like testcase shows.
Patch implements logic to merge relocation sections if their target
sections were merged into the same output section.
Differential revision: https://reviews.llvm.org/D33824
llvm-svn: 304886
|
|
|
|
|
|
| |
This now just requires not calling assignOffsets after it.
llvm-svn: 304861
|
|
|
|
|
|
|
|
| |
Before this patch in -r we compute the OutputSection sizes early in
the various calls to assignOffsets. With this change we can remove
most of those calls.
llvm-svn: 304860
|
|
|
|
|
|
|
| |
This removes a mapping from OutputSection to OutputSectionCommand and
is another step in moving clearOutputSections earlier.
llvm-svn: 304821
|
|
|
|
| |
llvm-svn: 304820
|
|
|
|
|
|
| |
This is defined by both bfd and gold and used by the android libc.
llvm-svn: 304803
|
|
|
|
|
|
|
| |
This moves clearOutputSections and OutputSectionCommands creation as
early as possible without changing other code.
llvm-svn: 304751
|