| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
This is similar to what we do for InputSections and makes them easier
to access.
llvm-svn: 305337
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 removes a mapping from OutputSection to OutputSectionCommand and
is another step in moving clearOutputSections earlier.
llvm-svn: 304821
|
|
|
|
|
|
|
| |
This allows us to remove the PageAlign field. It will also allow
moving fabricateDefaultCommands earlier.
llvm-svn: 304513
|
|
|
|
|
|
|
| |
This removes a call to getCmd and allows us to move
clearOutputSections earlier.
llvm-svn: 304439
|
|
|
|
|
|
|
| |
By the time we get here all live sections should have been combined
into InputSections.
llvm-svn: 304243
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reduces how many times we have to map from OutputSection to
OutputSectionCommand. It is a required step to moving
clearOutputSections earlier.
In order to always use writeTo in OutputSectionCommand we have to call
fabricateDefaultCommands for -r links and move section compression
after it.
llvm-svn: 303784
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We used to place orphans by just using compareSectionsNonScript.
Then we noticed that since linker scripts can use another order, we
should first try match the section to a given PT_LOAD. But there is
nothing special about PT_LOAD. The same issue can show up for
PT_GNU_RELRO for example.
In general, we have to search for the most similar section and put the
orphan next to it. Most similar being defined as how long they follow
the same code path in compareSecitonsNonScript.
That is what this patch does. We now compute a rank for each output
section, with a bit for each branch in what was
compareSectionsNonScript.
With this findOrphanPos is now fully general and orphan placement can
be optimized by placing every section with the same rank at once.
The included testcase is a variation of many-sections.s that uses
allocatable sections to avoid the fast path in the existing
code. Without threads it goes form 46 seconds to 0.9 seconds.
llvm-svn: 302903
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were already pretty close, the one exception was when a name was
reused in another SECTIONS directive:
SECTIONS {
.text : { *(.text) }
.data : { *(.data) }
}
SECTIONS {
.data : { *(other) }
}
In this case we would create a single .data and magically output
"other" while looking at the first OutputSectionCommand.
We now create two .data sections. This matches what gold does. If we
really want to create a single one, we should change the parser so that
the above is parsed as if the user had written
SECTIONS {
.text : { *(.text) }
.data : { *(.data) *(other)}
}
That is, there should be only one OutputSectionCommand for .data and
it would have two InputSectionDescriptions.
By itself this patch makes the code a bit more complicated, but is an
important step in allowing assignAddresses to operate just on the
linker script.
llvm-svn: 301484
|
|
|
|
|
|
|
| |
`CompressedHeader` is a header for compressed data, and the header
itself is not compressed. So the previous name was confusing.
llvm-svn: 300675
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patch implements --compress-debug-sections=zlib.
In compare with D20211 (a year old patch, abandoned), it implementation
uses streaming and fully reimplemented, does not support zlib-gnu for
simplification.
This is PR32308.
Differential revision: https://reviews.llvm.org/D31941
llvm-svn: 300444
|
|
|
|
| |
llvm-svn: 300004
|
|
|
|
|
|
| |
This follows r299748 which fixed a latent bug the original commit exposed.
llvm-svn: 299755
|
|
|
|
|
|
| |
The argument was always casted, so cast it in the caller.
llvm-svn: 299742
|
|
|
|
| |
llvm-svn: 299655
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Executable sections should not be padded with zero by default. On some
architectures, 0x00 is the start of a valid instruction sequence, so can confuse
disassembly between InputSections (and indeed the start of the next InputSection
in some situations). Further, in the case of misjumps into padding, padding may
start to be executed silently.
On x86, the "0xcc" byte represents the int3 trap instruction. It is a single
byte long so can serve well as padding. This change switches x86 (and x86_64) to
use this value for padding in executable sections, if no linker script directive
overrides it. It also puts the behaviour into place making it easy to change the
behaviour of other targets when desired. I do not know the relevant instruction
sequences for trap instructions on other targets however, so somebody should add
this separately.
Because the old behaviour simply wrote padding in the whole section before
overwriting most of it, this change also modifies the padding algorithm to write
padding only where needed. This in turn has caused a small behaviour change with
regards to what values are written via Fill commands in linker scripts, bringing
it into line with ld.bfd. The fill value is now written starting from the end of
the previous block, which means that it always starts from the first byte of the
fill, whereas the old behaviour meant that the padding sometimes started mid-way
through the fill value. See the test changes for more details.
Reviewed by: ruiu
Differential Revision: https://reviews.llvm.org/D30886
Bugzilla: http://bugs.llvm.org/show_bug.cgi?id=32227
llvm-svn: 299635
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Was fixed, details on review page.
Original commit message:
That removes CopyRelSection class completely, making
Bss/BssRelRo to be just regular synthetics.
This is splitted from D30541 and polished.
Difference from D30541 that all logic of SharedSymbol
converting to DefinedRegular was removed for now and
probably will be posted as separate patch.
Differential revision: https://reviews.llvm.org/D30892
llvm-svn: 298062
|
|
|
|
| |
llvm-svn: 297937
|
|
|
|
|
|
| |
OutputSectionFactory has no ELFT templates anymore.
llvm-svn: 297720
|
|
|
|
| |
llvm-svn: 297622
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this we have a single section hierarchy. It is a bit less code,
but the main advantage will be in a future patch being able to handle
foo = symbol_in_obj;
in a linker script. Currently that fails since we try to find the
output section of symbol_in_obj. With this we should be able to just
return an InputSection from the expression.
llvm-svn: 297313
|
|
|
|
| |
llvm-svn: 297305
|
|
|
|
|
|
|
| |
This reverts commit r297008 because it's reported that that
change broke AArch64 bots.
llvm-svn: 297297
|
|
|
|
|
|
| |
This is consistent with what we do for input sections.
llvm-svn: 297152
|
|
|
|
|
|
| |
It now matches the name used in InputSectionBase.
llvm-svn: 297144
|
|
|
|
| |
llvm-svn: 297077
|
|
|
|
| |
llvm-svn: 297061
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In compare with D30458, this makes Bss/BssRelRo to be pure
synthetic sections.
That removes CopyRelSection class completely, making
Bss/BssRelRo to be just regular synthetics.
SharedSymbols involved in creating copy relocations are
converted to DefinedRegular, what also simplifies things.
Differential revision: https://reviews.llvm.org/D30541
llvm-svn: 297008
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D30348
llvm-svn: 296508
|
|
|
|
|
|
|
| |
Since OutputSection is no longer a template, it doesn't make much
sense to tempalte its factory class.
llvm-svn: 296308
|
|
|
|
| |
llvm-svn: 296307
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D30351
llvm-svn: 296303
|
|
|
|
|
|
|
| |
Now that all special sections are SyntheticSections, we only need one
OutputSection class.
llvm-svn: 296127
|
|
|
|
| |
llvm-svn: 296124
|
|
|
|
| |
llvm-svn: 296123
|
|
|
|
| |
llvm-svn: 296118
|
|
|
|
|
|
|
|
| |
With this we complete the transition out of special output sections,
and with the previous patches it should be possible to merge
OutputSectionBase and OuputSection.
llvm-svn: 296023
|
|
|
|
|
|
|
|
|
| |
With the current design an InputSection is basically anything that
goes directly in a OutputSection. That includes plain input section
but also synthetic sections, so this should probably not be a
template.
llvm-svn: 295993
|
|
|
|
|
|
|
| |
Now that InputSectionBase is not a template there is no reason to have
the two.
llvm-svn: 295924
|
|
|
|
|
|
|
| |
Removing this template is not a big win by itself, but opens the way
for removing more templates.
llvm-svn: 295923
|
|
|
|
| |
llvm-svn: 295909
|
|
|
|
|
|
|
| |
I cannot reproduce the issue locally, but for some reason some bots
want to instantiate this from the header.
llvm-svn: 295365
|
|
|
|
|
|
|
| |
We can do this now that the linker script and the writer agree on
which sections should be combined.
llvm-svn: 295341
|
|
|
|
| |
llvm-svn: 294057
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With a synthetic merge section we can have, for example, a single
.rodata section with stings, fixed sized constants and non merge
constants.
I can be simplified further by not setting Entsize, but that is
probably better done is a followup patch.
This should allow some cleanup in the linker script code now that
every output section command maps to just one output section.
llvm-svn: 294005
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[ELF] Fixed formatting. NFC
and
[ELF] Bypass section type check
Differential revision: https://reviews.llvm.org/D28761
They do the opposite of what was asked for in the code review.
llvm-svn: 293320
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D28761
llvm-svn: 293276
|
|
|
|
|
|
|
| |
The format is not exactly the same as the one in bfd since bfd always
follows a linker script and prints it along.
llvm-svn: 291958
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When reserving copy relocation space for a shared symbol, scan the DSO's
program headers to see if the symbol is in a read-only segment. If so,
reserve space for that symbol in a new synthetic section named .bss.rel.ro
which will be covered by the relro program header.
This fixes the security issue disclosed on the binutils mailing list at:
https://sourceware.org/ml/libc-alpha/2016-12/msg00914.html
Differential Revision: https://reviews.llvm.org/D28272
llvm-svn: 291524
|
|
|
|
| |
llvm-svn: 291113
|