| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 221425
|
|
|
|
| |
llvm-svn: 221423
|
|
|
|
|
|
|
|
|
|
| |
Darwin uses two-level-namespace lookup for symbols which means the static
linker records where each symbol must be found at runtime. Thus defining a
symbol in a dylib loaded earlier will not effect where symbols needed by
later dylibs will be found. Instead overriding is done through a section
of type S_INTERPOSING which contains tuples of <interposer, interposee>.
llvm-svn: 221421
|
|
|
|
|
|
|
|
|
|
| |
SECREL relocation's value is the offset to the beginning of the section.
Because of the off-by-one error, if a SECREL relocation target is at the
beginning of a section, it got wrong value.
Added a test that would have caught this.
llvm-svn: 221420
|
|
|
|
|
|
|
|
|
| |
The local variable `cfi` became dead in r220730 when it's use was
obviated; it was replaced with a call to read32.
No functionality change intended.
llvm-svn: 221412
|
|
|
|
|
|
|
| |
The st_other field can contains not only visibility flag so we should
retrieve a visibility flag using a bit-mask.
llvm-svn: 221397
|
|
|
|
|
|
|
|
|
| |
Many programs, for reasons unknown, really like to look at the
AddressOfRelocationTable to determine whether or not they are looking at
a bona fide PE file. Without this, programs like the UNIX `file'
utility will insist that they are looking at a MS DOS executable.
llvm-svn: 221335
|
|
|
|
|
|
|
|
|
| |
LLD skipped COMDAT section symbols when reading them because
I thought we don't want to have symbols with the same name.
But they are actually needed because relocations may refer to
the section symbols. So we shoulnd't skip them.
llvm-svn: 221329
|
|
|
|
| |
llvm-svn: 221303
|
|
|
|
|
|
|
|
|
|
| |
The job of the CompactUnwind pass is to turn __compact_unwind data (and
__eh_frame) into the compressed final form in __unwind_info. After it's done,
the original atoms are no longer relevant and should be deleted (they cause
problems during actual execution, quite apart from the fact that they're not
needed).
llvm-svn: 221301
|
|
|
|
| |
llvm-svn: 221257
|
|
|
|
| |
llvm-svn: 221235
|
|
|
|
|
|
|
|
| |
For some reason, MSVC doesnot like the style.
Checking to make sure this fixes the problem with the build.
llvm-svn: 221234
|
|
|
|
|
|
|
|
|
| |
The ELF writer creates a invalid binary for few cases with large filesize and
memory size for segments. This patch addresses the functionality and updates the
test. This patch also cleans up parts of the ELF writer for future enhancements
to support Linker scripts.
llvm-svn: 221233
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Normally, PE files have section names of eight characters or less.
However, this is problematic for DWARF because DWARF section names are
things like .debug_aranges.
Instead of truncating the section name, redirect the section name into
the string table.
Differential Revision: http://reviews.llvm.org/D6104
llvm-svn: 221212
|
|
|
|
| |
llvm-svn: 221180
|
|
|
|
| |
llvm-svn: 221179
|
|
|
|
| |
llvm-svn: 221165
|
|
|
|
|
|
|
| |
Number parsing functions used an ErrorOr<> idiom that is not supported in
MSVC2012. This patch fixes this.
llvm-svn: 221128
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch does *not* implement any semantic actions, but it is a first step to
teach LLD how to read complete linker scripts. The additional linker scripts
statements whose parsing is now supported are:
* SEARCH_DIR directive
* SECTIONS directive
* Symbol definitions inside SECTIONS including PROVIDE and PROVIDE_HIDDEN
* C-like expressions used in many places in linker scripts
* Input to output sections mapping
The goal of this commit was guided towards completely parsing a default GNU ld
linker script and the linker script used to link the FreeBSD kernel. Thus, it
also adds a test case based on the default linker script used in GNU ld for
x86_64 ELF targets. I tested SPEC userland programs linked by GNU ld, using the
linker script dump'ed by this parser, and everything went fine. I then tested
linking the FreeBSD kernel with a dump'ed linker script, installed the new
kernel and booted it, everything went fine.
Directives that still need to be implemented:
* MEMORY
* PHDRS
Reviewers: silvas, shankarke and ruiu
http://reviews.llvm.org/D5852
llvm-svn: 221126
|
|
|
|
|
|
| |
Hopefully this'll fix the build failure in the bot.
llvm-svn: 221007
|
|
|
|
|
|
|
| |
These are used to reference typeinfo data in the exception table section, for
example.
llvm-svn: 220916
|
|
|
|
|
|
|
|
|
| |
lld was regenerating LC_DATA_IN_CODE in .o output files, but not into
final linked images.
Update test case to verify data-in-code info makes it into final linked images.
llvm-svn: 220827
|
|
|
|
| |
llvm-svn: 220730
|
|
|
|
| |
llvm-svn: 220668
|
|
|
|
|
|
|
| |
r220665 makes configure or CMake to set HAVE_CXXABI_H on FreeBSD 10.0.
We don't need this ugly ifdef condition anymore.
llvm-svn: 220666
|
|
|
|
|
|
|
|
|
| |
Objective-C switched to a new ABI which uses a different mangling for class
names. But to keep projects building that use export lists that use the old
class name mangling, the linker recognizes the old names and transforms them
to the new mangling.
llvm-svn: 220598
|
|
|
|
|
|
|
|
| |
In final linked shared images, the __TEXT segment contains both code and
the mach-o header/load-commands. In the case of a data-only dylib, there is
no code, so we need to force the addition of the __TEXT segment.
llvm-svn: 220597
|
|
|
|
|
|
|
|
|
|
|
| |
This is a follow-up patch for r220333. r220333 renames exported symbols.
That raised another issue; if we have both decorated and undecorated names
for the same symbol, we'll end up have two duplicate exported symbol
entries.
This is a fix for that issue by removing duplciate entries.
llvm-svn: 220350
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All compiler generated mach-o object files are marked with MH_SUBSECTIONS_VIA_SYMBOLS.
But hand written assembly files need to opt-in if they are written correctly.
The flag means the linker can break up a sections at symbol addresses and
dead strip or re-order functions.
This change recognizes object files without the flag and marks its atoms as
not dead strippable and adds a layout-after chain of references so that the
atoms cannot be re-ordered.
llvm-svn: 220348
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are two ways to specify a symbol to be exported in the module
definition file.
1) EXPORT <external name> = <symbol>
2) EXPORT <symbol>
In (1), you give both external name and internal name. In that case,
the linker tries to find a symbol using the internal name, and write
that address to the export table with the external name. Thus, from
the outer world, the symbol seems to be exported as the external name.
In (2), internal name is basically the same as the external name
with an exception: if you give an undecorated symbol to the EXPORT
directive, and if the linker finds a decorated symbol, the external
name for the symbol will become the decorated symbol.
LLD didn't implement that exception correctly. This patch fixes that.
llvm-svn: 220333
|
|
|
|
| |
llvm-svn: 220326
|
|
|
|
|
|
|
| |
HAVE_CXXABI_H is not defined on FreeBSD but the system actually
has the header. CMake test fails because the header depends on size_t.
llvm-svn: 220315
|
|
|
|
|
|
|
| |
The base class ELFObjectReader/ELFDSOReader implement the canParse functionaity
with this change.
llvm-svn: 220261
|
|
|
|
|
|
|
| |
Entry symbol name can be decorated. When we look for _WinMain, we
also have to look for _WinMain@16.
llvm-svn: 220259
|
|
|
|
|
|
|
| |
This adds functionality in the GNU flavor to demangle symbols when
undefined symbols are displayed to the user.
llvm-svn: 220184
|
|
|
|
|
|
|
|
|
|
| |
The canParse function for all the ELF subtargets check if the input files match
the subtarget.
There were few mismatches in the input files that didnt match the subtarget for
which the link was being invoked, which also acts as a test for this change.
llvm-svn: 220182
|
|
|
|
|
|
|
| |
The ELF subtargets would usually want to override the function
updateReferenceForMergeStringAccess. Allow this by making it virtual.
llvm-svn: 220180
|
|
|
|
|
|
|
|
| |
For PC relative accesses, negative addends were to be ignored. The linker was
not ignoring it and would fail with an assert. This fixes the issue and is able
to get Helloworld working.
llvm-svn: 220179
|
|
|
|
|
|
|
|
| |
The old code was used as a workaround to fix how relocations are calculated for
sections with SHF_MERGE|SHF_STRINGS attribute. This patch removes the erroneous
code.
llvm-svn: 220159
|
|
|
|
|
|
|
|
|
|
| |
This fixes the way archive members are displayed when the linker is used with a
flag to show all the files that it processes.
When an archive file member is read, we need to show the archive filename and
the member.
llvm-svn: 220144
|
|
|
|
| |
llvm-svn: 220131
|
|
|
|
|
|
|
|
|
| |
This would permit the ELF reader to check the architecture that is being
selected by the linking process.
This patch also sorts the include files according to LLVM conventions.
llvm-svn: 220129
|
|
|
|
|
|
|
|
| |
The code was making non-portable assumptions about the exact string returned by
the glob (possibly by the shell?); this is more robust and matches what is done
everywhere else.
llvm-svn: 220117
|
|
|
|
|
|
| |
&v[v.size()] may be invalid C++.
llvm-svn: 220115
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we supported x86 only. This patch is to support x64.
The array of pointers to delay-loaded functions points the
DLL delay loading function at start-up. When a function is called
for the first time, the delay loading function gets called and
then rewrite the function pointer array.
llvm-svn: 220096
|
|
|
|
|
|
|
| |
target_link_libraries. [PR20254]
FIXME: Dependencies should be reorganized.
llvm-svn: 220000
|
|
|
|
|
|
|
| |
First, add a comment to support more variation in FDE formats. Second, refactor
fde -> function handling into a separate function living in the ArchHandler.
llvm-svn: 219959
|
|
|
|
|
|
|
|
| |
To deal with cycles in shared library dependencies, the darwin linker supports
marking specific link dependencies as "upward". An upward link is when a
lower level library links against a higher level library.
llvm-svn: 219949
|
|
|
|
|
|
|
|
|
|
| |
This patch creates the import address table and sets its
address to the delay-load import table. This also creates
wrapper functions for __delayLoadHelper2.
x86 only for now.
llvm-svn: 219948
|