| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The linker will normally set the LMA equal to the VMA.
You can change that by using the AT keyword.
The expression lma that follows the AT keyword specifies
the load address of the section.
Patch implements this keyword.
Differential revision: https://reviews.llvm.org/D19272
llvm-svn: 278911
|
|
|
|
|
|
| |
The FreeBSD kernel relies on this behavior to not overwrite the boot loader.
llvm-svn: 278889
|
|
|
|
|
|
| |
PT_INTERP
llvm-svn: 278781
|
|
|
|
|
|
|
|
|
| |
This add support for HIDDEN command which can be used to define
a symbol that will be hidden and won't be exported.
Differential Revision: https://reviews.llvm.org/D23534
llvm-svn: 278770
|
|
|
|
| |
llvm-svn: 278663
|
|
|
|
|
|
|
|
|
|
| |
Previously we searched output section by name to assign VA. That did not
work in the case when multiple output sections with different constraints were defined in script.
Testcase shows the possible issue scenario, patch fixes the issue.
Differential revision: https://reviews.llvm.org/D23451
llvm-svn: 278561
|
|
|
|
|
|
|
|
|
|
| |
After 278461 "Create only one section for a name in LinkerScript."
this loop is excessive.
Patch also reorders code slightly to use early return.
Differential revision: https://reviews.llvm.org/D23442
llvm-svn: 278554
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
functionality.
Previously filtering that was used worked incorrectly.
For example for next script it would just remove both sections completely:
SECTIONS {
. = 0x1000;
.aaa : ONLY_IF_RW { *(.aaa.*) }
. = 0x2000;
.aaa : ONLY_IF_RO { *(.aaa.*) }
}
Patch fixes above issues and adds testcase showing the issue. Testcase is a subset of
FreeBSD script which has:
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
...
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
Differential revision: https://reviews.llvm.org/D23326
llvm-svn: 278486
|
|
|
|
|
|
|
| |
We have getSectionSize for SIZEOF command. So, I think
getHeaderSize is a better name for SIZEOF_HEADERS.
llvm-svn: 278470
|
|
|
|
| |
llvm-svn: 278465
|
|
|
|
|
|
|
|
|
| |
Previously, we were setting LayoutInputSection's OutputSection member
in createSections. Because when we create LayoutInputSectinos, we
don't know the output section for them, so we backfilled the member
in the function. This patch moves the code to backfill it to assignOffsets.
llvm-svn: 278464
|
|
|
|
| |
llvm-svn: 278462
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we created two or more output sections if there are
input sections with the same name but with different attributes.
That is a wrong behavior. This patch fixes the issue.
One thing we need to do is to merge output section attributes.
Currently, we create an output section based on the first input
section's attributes. This may make a wrong output section
attributes. What we need to do is to bitwise-OR attributes.
We'll do it in a follow-up patch.
llvm-svn: 278461
|
|
|
|
| |
llvm-svn: 278453
|
|
|
|
|
|
|
|
| |
The reason why we had to assign offsets only to sections that
don't contain layout sections were unclear. It turned out that
we can live without it.
llvm-svn: 278449
|
|
|
|
| |
llvm-svn: 278446
|
|
|
|
|
|
| |
Also avoid to use a lambda that is called only once.
llvm-svn: 278445
|
|
|
|
| |
llvm-svn: 278439
|
|
|
|
|
|
|
| |
LayoutInputSection is a dummy class and does not need any features
that the actual implementation (InputSection class) provides.
llvm-svn: 278430
|
|
|
|
| |
llvm-svn: 278420
|
|
|
|
| |
llvm-svn: 278408
|
|
|
|
| |
llvm-svn: 278322
|
|
|
|
|
|
|
|
|
|
|
| |
SIZEOF_HEADERS - Return the size in bytes of the output file’s headers.
It is is a feature used in FreeBsd script, for example.
There is a discussion on PR28688 page about it.
Differential revision: https://reviews.llvm.org/D23165
llvm-svn: 278204
|
|
|
|
| |
llvm-svn: 278096
|
|
|
|
|
|
|
| |
This patch is to not instantiate DynSymTab and DynStrTab if the
output is not a dynamic output.
llvm-svn: 278095
|
|
|
|
| |
llvm-svn: 277794
|
|
|
|
| |
llvm-svn: 277791
|
|
|
|
|
|
| |
Because this function depends only on its arguments.
llvm-svn: 277790
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The comparator function to compare input sections as instructed by
SORT command was a bit too complicated because it needed to handle
four different cases. This patch split it into two function calls.
This patch also simplifies the parser.
Reviewers: grimar
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23140
llvm-svn: 277780
|
|
|
|
|
|
| |
But always set Script<ELFT>::X->OutputSections.
llvm-svn: 277720
|
|
|
|
|
|
|
|
|
|
|
|
| |
ASSERT(exp, message)
Ensure that exp is non-zero. If it is zero, then exit the linker with an error
code, and print message.
ASSERT is useful and was seen in few projects in the wild.
Differential revision: https://reviews.llvm.org/D22912
llvm-svn: 277710
|
|
|
|
|
|
|
|
|
|
| |
According to spec:
"SORT_BY_ALIGNMENT will sort sections into descending order by
alignment before placing them in the output file"
Previously they were sorted into ascending order.
llvm-svn: 277706
|
|
|
|
| |
llvm-svn: 277703
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the previous change, it is now obvious that readProvide in
this context appended new commands to a wrong command list.
It was mistakenly adding new commands to the top level.
Thus, all commands inside output section descriptions were
interpreted as they were written on top level.
PROVIDE command naturally requires symbol assignment support
in the output section description. We don't have that one yet.
I removed the implementation because there's no way to fix it now.
We can resurrect the test once we support the symbol assignment
(with a modification to detect errors that we failed to find as
described.)
llvm-svn: 277687
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, many read* functions created new command objects and
add them directly to the top-level data structure. This is not
work for some commands because some commands, such as the assignment,
can appear inside and outside of the output section description.
This patch is to not append objects to the top-level data structure.
Callers are now responsible to do that.
llvm-svn: 277686
|
|
|
|
|
|
|
|
|
|
| |
Previously, a decimal filler expression is interpreted as a byte value.
Gold on the other hand use it as a 32-bit big-endian value.
This patch fixes the compatibility issue.
Differential Revision: https://reviews.llvm.org/D23142
llvm-svn: 277680
|
|
|
|
|
|
|
| |
In this for-loop, we append elements from one vector to another,
which is a bit inefficient.
llvm-svn: 277653
|
|
|
|
| |
llvm-svn: 277599
|
|
|
|
| |
llvm-svn: 277594
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we supported only sorting by name.
When there are nested section sorting commands in linker script, there can be at most 1
level of nesting for section sorting commands.
SORT_BY_NAME (SORT_BY_ALIGNMENT (wildcard section pattern)). It will sort the input
sections by name first, then by alignment if 2 sections have the same name.
SORT_BY_ALIGNMENT (SORT_BY_NAME (wildcard section pattern)). It will sort the input
sections by alignment first, then by name if 2 sections have the same alignment.
SORT_BY_NAME (SORT_BY_NAME (wildcard section pattern)) is treated the same as SORT_
BY_NAME (wildcard section pattern).
SORT_BY_ALIGNMENT (SORT_BY_ALIGNMENT (wildcard section pattern)) is treated the
same as SORT_BY_ALIGNMENT (wildcard section pattern).
All other nested section sorting commands are invalid.
Patch implements that all above.
Differential revision: https://reviews.llvm.org/D23019
llvm-svn: 277583
|
|
|
|
|
|
|
| |
This is an undocumented bfd feature. It is reasonable for making the
scripts a bit more readable.
llvm-svn: 277532
|
|
|
|
| |
llvm-svn: 277222
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SIZEOF(section)
Return the size in bytes of the named section, if that section has been allocated.
SIZEOF(section) often used in scripts. Few examples from the wild:
https://github.com/chipKIT32/pic32-Arduino-USB-Bootloader-original/blob/master/boot-linkerscript.ld
https://github.com/devkitPro/buildscripts/blob/master/dkarm-eabi/crtls/gba_cart.ld
Patch implements it.
Differential revision: https://reviews.llvm.org/D22915
llvm-svn: 277165
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the SORT keyword is used, the linker will sort the files or sections into ascending order by name before placing them in the output file.
It is used in FreeBSD script:
https://svnweb.freebsd.org/base/head/sys/conf/ldscript.amd64?revision=284870&view=markup#l139
This is PR28689.
Differential revision: https://reviews.llvm.org/D22749
llvm-svn: 277153
|
|
|
|
| |
llvm-svn: 277150
|
|
|
|
| |
llvm-svn: 277147
|
|
|
|
| |
llvm-svn: 277122
|
|
|
|
| |
llvm-svn: 277121
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, Ignore flag is set if we don't want to assign
a value to symbols. It happens if a symbol assingment is in
PROVIDE() and there's already a symbol with the same name.
The previous code had a subtle but that we assume that the
existing symbol is an absolute symbol even if it is not.
This patch fixes the issue by always overwriting an absolute
symbol.
llvm-svn: 277115
|
|
|
|
| |
llvm-svn: 277102
|