| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
target independent.
llvm-svn: 214641
|
|
|
|
|
|
| |
target independent.
llvm-svn: 214495
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The PE/COFF spec says that SizeOfRawData field in the section
header must be a multiple of FileAlignment from the optional
header. LLD emits 512 as FileAlignment, so it must have been
a multiple of 512.
LLD did not follow that. It emitted the actual section size
without the last padding as the SizeOfRawData. Although it's
not correct as per the spec, the Windows loader doesn't seem
to actually bother to check that. Executables created by LLD
worked fine.
However, tools dealing with executalbe files may expect it
to be the correct value, and one instance of it is mt.exe
tool distributed as a part of Windows SDK.
If CMake is invoked with "-E vs_link_exe" option, it silently
run mt.exe to embed a resource file to the resulting file.
And mt.exe sometimes breaks an input file if it's section
header does not follow the standard. That caused a misterous
error that CMake with Ninja occasionally produces a broken
executable.
This patch fixes the section header to make mt.exe and
other tools happy.
llvm-svn: 214453
|
|
|
|
| |
llvm-svn: 214420
|
|
|
|
| |
llvm-svn: 214414
|
|
|
|
| |
llvm-svn: 214378
|
|
|
|
| |
llvm-svn: 214278
|
|
|
|
|
|
|
|
| |
In some cases the address of a function will be materialized with a movw/movt
pair. If the function is a thumb function, the low bit needs to be set on
the movw immediate value.
llvm-svn: 214277
|
|
|
|
|
|
|
|
|
|
|
|
| |
The -sectalign option is used to increase the alignment required for a section.
It required some reworking of how the __TEXT segment is laid out because that
segment also contains the mach_header and load commands. And the size of load
commands depend on the number of segments, sections, and dependent dylibs used.
Using this option will simplify some future test cases because the final
address of code can be pinned down, making tests of its content easier.
llvm-svn: 214268
|
|
|
|
| |
llvm-svn: 214145
|
|
|
|
|
|
|
|
|
|
|
| |
All iOS arm processor support switching between arm and thumb mode at call sites
by using the BLX instruction (instead of BL). But the compiler does not know
the implementation mode for extern functions, so the linker must update BL/BLX
instructions to match what is linked is actually linked together. In addition,
pointers to functions (such as vtables) must have the low bit set if the target
of the pointer is a thumb mode function.
llvm-svn: 214140
|
|
|
|
|
|
| |
This should be covered by the Driver's unit tests.
llvm-svn: 214134
|
|
|
|
|
|
| |
The exe-got.test test case is target independent.
llvm-svn: 214085
|
|
|
|
| |
llvm-svn: 213984
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following expression
m[i] = m[j]
where m is a DenseMap and i != j is not safe. m[j] returns a
reference, which would be invalidated when a rehashing occurs.
If rehashing occurs to make room for m[i], m[j] becomes
invalid, and that invalid reference would be used as the RHS
value of the expression.
llvm-svn: 213969
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sometimes compilers emit data into code sections (e.g. constant pools or
jump tables). These runs of data can throw off disassemblers. The solution
in mach-o is that ranges of data-in-code are encoded into a table pointed to
by the LC_DATA_IN_CODE load command.
The way the data-in-code information is encoded into lld's Atom model is that
that start and end of each data run is marked with a Reference whose offset
is the start/end of the data run. For arm, the switch back to code also marks
whether it is thumb or arm code.
llvm-svn: 213901
|
|
|
|
|
|
| |
target independent.
llvm-svn: 213868
|
|
|
|
|
|
|
|
|
|
| |
insertElementAt(x, END) does the identical thing as addInputElement(x),
so the only reasonable use of insertElementAt is to call it with the
other possible argument, BEGIN. That means the second parameter of the
function is just redundant. This patch is to remove the second
parameter and rename the function accordingly.
llvm-svn: 213821
|
|
|
|
|
|
| |
insertElementAt(x, END) is the same as addInputElement(x).
llvm-svn: 213818
|
|
|
|
|
|
|
|
|
| |
The entry point file needs to be processed after all other
object files and before all .lib files. It was processed
after .lib files. That caused an issue that the entry point
function was not resolved from the standard library files.
llvm-svn: 213804
|
|
|
|
|
|
|
| |
Because of a bug, the entry point address in the PE/COFF header
was not correct.
llvm-svn: 213802
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Windows there are four "main" functions -- main, wmain, WinMain,
or wWinMain. Their parameter types are diffferent. The standard
library provides four different entry functions (i.e.
{w,}{WinMain,main}CRTStartup) for them. You need to use the right
entry routine for your "main" function.
If you give an /entry option, the specified name is used
unconditionally.
Otherwise, the linker needs to select the right one based on
user-supplied entry point function. This can be done after the
linker reads all the input files.
This patch moves the code to determine the entry point function
from the driver to a virtual input file. It also implements the
correct logic for the entry point function selection.
llvm-svn: 213713
|
|
|
|
|
|
|
|
|
| |
This patch just supports marking ranges that are thumb code (vs arm code).
Future patches will mark data and jump table ranges. The ranges are encoded
as References with offsetInAtom being the start of the range and the target
being the same atom.
llvm-svn: 213712
|
|
|
|
|
|
|
| |
Update the parse-arm-relocs.yaml test case to run the linker back to back
to ensure all relocations round trip in and out of mach-o.
llvm-svn: 213700
|
|
|
|
|
|
| |
So that it can be shared by multiple input files.
llvm-svn: 213699
|
|
|
|
|
|
|
|
|
|
| |
This is a part of a larger change to move the entry point
processing to a later pass than the driver. On Windows the default
entry point function varies depending on user-provided functions.
That means the driver is not able to correctly know the entry point
function name. Only passes after the core linker can infer it.
llvm-svn: 213697
|
|
|
|
|
|
| |
independent.
llvm-svn: 213690
|
|
|
|
| |
llvm-svn: 213592
|
|
|
|
|
|
|
| |
Over time the symbols and relocations have changed for dwarf unwind info
in the __eh_frame section. Add test cases for older and new style.
llvm-svn: 213585
|
|
|
|
| |
llvm-svn: 213560
|
|
|
|
| |
llvm-svn: 213520
|
|
|
|
|
|
| |
test target independent.
llvm-svn: 213480
|
|
|
|
|
|
| |
target independent.
llvm-svn: 213462
|
|
|
|
|
|
| |
target independent.
llvm-svn: 213390
|
|
|
|
| |
llvm-svn: 213362
|
|
|
|
| |
llvm-svn: 213344
|
|
|
|
| |
llvm-svn: 213340
|
|
|
|
|
|
|
|
|
| |
Add support for adding section relocations in -r mode. Enhance the test
cases which validate the parsing of .o files to also round trip. They now
write out the .o file and then parse that, verifying all relocations survived
the round trip.
llvm-svn: 213333
|
|
|
|
| |
llvm-svn: 213323
|
|
|
|
|
|
|
|
|
| |
The code to manage resolvable symbols is now separated from
ExportedSymbolRenameFile so that other class can reuse it.
I'm planning to use it to find the entry function symbol
based on resolvable symbols.
llvm-svn: 213322
|
|
|
|
| |
llvm-svn: 213313
|
|
|
|
| |
llvm-svn: 213312
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 213310
|
|
|
|
|
|
|
| |
Windows loader can load a DLL without this bit but it wouldn't
call the initializer function in the DLL if the bit is absent.
llvm-svn: 213216
|
|
|
|
| |
llvm-svn: 213195
|
|
|
|
|
|
|
|
|
|
|
| |
All architecture specific handling is now done in the appropriate
ArchHandler subclass.
The StubsPass and GOTPass have been simplified. All architecture specific
variations in stubs are now encoded in a table which is vended by the
current ArchHandler.
llvm-svn: 213187
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
command.
There are two forms of `-l` prefixed expression:
* -l<libname>
* -l:<filename>
In the first case a linker should construct a full library name
`lib + libname + .[so|a]` and search this library as usual. In the second case
a linker should use the `<filename>` as is and search this file through library
search directories.
The patch reviewed by Shankar Easwaran.
llvm-svn: 213077
|
|
|
|
| |
llvm-svn: 212949
|
|
|
|
| |
llvm-svn: 212927
|
|
|
|
| |
llvm-svn: 212813
|