| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
No functional changes.
llvm-svn: 222324
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 222323
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 222322
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 222321
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 222320
|
|
|
|
|
|
|
|
| |
Move functionality from MIPS target to DefaultLayout.
No change in functionality.
llvm-svn: 222313
|
|
|
|
|
|
|
| |
Linker was creating a separate output segment in some cases if input sections
had huge alignments. This patch fixes the issue.
llvm-svn: 222312
|
|
|
|
|
|
| |
No change in functionality.
llvm-svn: 222311
|
|
|
|
|
|
| |
No change in functionality.
llvm-svn: 222310
|
|
|
|
|
|
| |
No change in functionality.
llvm-svn: 222309
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mach-o does not use a simple SO_NEEDED to track dependent dylibs. Instead,
the linker copies four things from each dylib to each client: the runtime path
(aka "install name"), the build time, current version (dylib build number), and
compatibility version The build time is no longer used (it cause every rebuild
of a dylib to be different). The compatibility version is usually just 1.0
and never changes, or the dylib becomes incompatible.
This patch copies that information into the NormalizedMachO format and
propagates it to clients.
llvm-svn: 222300
|
|
|
|
|
|
|
|
|
| |
This patch fixes the following MSVC warning.
warning C4334: '<<' : result of 32-bit shift implicitly
converted to 64 bits (was 64-bit shift intended?)
llvm-svn: 222293
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When fixing up BL instructions, the linker has to compare the thumbness of the
target to decide if the instruction needs to be converted to BLX. But with B
instruction there is no BX, so the linker asserts if the target is not the
same thumbness. This assert was firing in -r mode when the target was undefined
which it interpreted as being non-thumb.
Test case change is to add a B (in both thumb and arm code) to an undefined
symbol and round trip through -r mode.
llvm-svn: 222266
|
|
|
|
|
|
|
| |
In mach-o, sections of type S_ZEROFILL are special cased and to always have
their section.offset field be zero.
llvm-svn: 222202
|
|
|
|
| |
llvm-svn: 222201
|
|
|
|
|
|
|
|
|
|
|
| |
The arm64 assembler almost always uses r_extern=1 relocations in which the
r_symbolnum field is the index of the symbol the relocation references. But
sometimes it will set r_extern=0 in which case the linker needs to read the
content of the reloction to determine the target.
Add test case that the r_extern=0 relocation round trips.
llvm-svn: 222200
|
|
|
|
| |
llvm-svn: 222199
|
|
|
|
|
|
|
|
|
|
|
| |
The arm64 assembler almost always uses r_extern=1 relocations in which the
r_symbolnum field is the index of the symbol the relocation references. But
sometimes it will set r_extern=0 in which case the linker needs to read the
content of the reloction to determine the target.
Add test case that the r_extern=0 relocation round trips.
llvm-svn: 222198
|
|
|
|
| |
llvm-svn: 222197
|
|
|
|
| |
llvm-svn: 222116
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If you have something like
__declspec(align(8192)) int foo = 1;
in your code, the compiler makes the data to be aligned to 8192-byte
boundary, and the linker align the section containing the data to 8192.
LLD always aligned the section to 4192. So, as long as alignment
requirement is smaller than 4192, it was correct, but for larger
requirements, it's wrong.
This patch fixes the issue.
llvm-svn: 222043
|
|
|
|
|
|
|
|
|
| |
AddressOfEntryPoint is overridden after we layout all atoms (until then,
we don't know the entry point address for obvious reason.)
I believe this code is leftover from very early version of the
PE/COFF port that we only had an entry function in a test object file.
llvm-svn: 222026
|
|
|
|
| |
llvm-svn: 222021
|
|
|
|
| |
llvm-svn: 221974
|
|
|
|
|
|
|
| |
The dynamic section was not aligned properly. The alignment of the section is
determined by the word size of the architecture.
llvm-svn: 221972
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Fix comments from Rui, also adds a test.
llvm-svn: 221860
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
Each entry in the delay-import address table had a wrong alignment
requirement if 32 bit. As a result it got wrong delay-import table.
Because llvm-readobj doesn't print out that field, we don't have a
test for that. I'll submit a test that would catch this bug after
improving llvm-readobj.
llvm-svn: 221853
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The GOT slots were being laid out in a random order by the GOTPass which
caused randomness in the output file.
Note: With this change lld now bootstraps on darwin. That is:
1) link lld using system linker to make lld.1
2) link lld using lld.1 to make lld.2
3) link lld using lld.2 to make lld.3
Now lld.2 and lld.3 are identical.
llvm-svn: 221831
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On darwin in final linked images, the __TEXT segment covers that start of the
file. That means in memory a process can see the mach_header (and load commands)
for every loaded image in a process. There are APIs that take and return the
mach_header addresses as a way to specify a particular loaded image.
For completeness, any code can get the address of the mach_header of the image
it is in by using &__dso_handle. In addition there are mach-o type specific
symbols like __mh_execute_header.
The linker needs to supply a definition for any of these symbols if used. But
the address the symbol it resolves to is not in any section. Instead it is the
address of the start of the __TEXT segment.
I needed to make a small change to SimpleFileNode to not override
resetNextIndex() because the Driver creates a SimpleFileNode to hold the
internal/implicit files that the context/writer can create. For some reason
SimpleFileNode overrode resetNextIndex() to do nothing instead of reseting
the index (which mach-o needs if the internal file is an archive).
llvm-svn: 221822
|
|
|
|
|
|
|
|
|
|
| |
The way lazy binding works in mach-o is that the linker generates a helper
function and has the stub (PLT) initially jump to it. The helper function
pushes an extra parameter then jumps into dyld. The extra parameter is an
offset into the lazy binding info where dyld will find the information about
which symbol to bind and way lazy binding pointer to update.
llvm-svn: 221654
|
|
|
|
|
|
| |
Addressed comments from Sean silva.
llvm-svn: 221650
|
|
|
|
|
|
| |
This reverts commit r221583.
llvm-svn: 221649
|
|
|
|
| |
llvm-svn: 221648
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 221603
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 221602
|
|
|
|
|
|
| |
The value for --image-base is used as the base address of the program.
llvm-svn: 221589
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 221586
|
|
|
|
|
|
| |
Add options that are ignored and exists just for compatibility reasons.
llvm-svn: 221585
|
|
|
|
|
|
|
| |
The GNU linker allows the user to change the page size by using the option -z
max-page-size.
llvm-svn: 221584
|
|
|
|
|
|
|
|
|
| |
The parsing routines in the linker script to parse strings encoded in various
formats(hexadecimal, octal, decimal, etc), is needed by the GNU driver too. This
library provides helper functions for all flavors and flavors to add helper
functions which other flavors may make use of.
llvm-svn: 221583
|
|
|
|
| |
llvm-svn: 221572
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 221553
|
|
|
|
|
|
|
|
|
| |
My previous fix to have FileArchive own the member MemoryBuffers was not a
complete solution for darwin because nothing owned the FileArchive object.
Fixed MachOFileNode to be like ELFFileNode and have the graph node own the
archive object.
llvm-svn: 221552
|