| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
I think it is clear by now that the new linker is viable.
llvm-svn: 262158
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This is no longer needed now that the new ELF implementation supports AMDGPU.
Reviewers: ruiu, rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D15954
llvm-svn: 257390
|
|
|
|
|
|
|
|
|
| |
We used to parse the LLVM options in Driver::link. However, that is
after parse() where we load files. By moving the LLVM option handling
earlier, we can add DEBUG() to code such as MachONormalizedFileToAtoms.cpp
and have it enabled correctly by '-mllvm --debug'.
llvm-svn: 255819
|
|
|
|
|
|
| |
ArrayRef. NFC
llvm-svn: 250904
|
|
|
|
|
|
| |
MIPS ABI supports only --hash-style=sysv variant.
llvm-svn: 247796
|
|
|
|
|
|
| |
elf32btsmipn32/elf32ltsmipn32
llvm-svn: 246336
|
|
|
|
|
|
|
| |
Now it is possible to have mips-linux-gnu-ld executable and link MIPS 64-bit
little-endian binaries providing -melf64ltsmip command line argument.
llvm-svn: 246335
|
|
|
|
|
|
|
|
|
| |
This is a basic implementation that allows lld to emit binaries
consumable by the HSA runtime.
Differential Revision: http://reviews.llvm.org/D11267
llvm-svn: 246155
|
|
|
|
| |
llvm-svn: 244856
|
|
|
|
|
|
|
|
|
|
| |
Add PT_PHDR segment depending on its availability in linker script's
PHDRS command, fallback if no linker script is given.
Handle FILEHDR, PHDRS and FLAGS attributes of program header.
Differential Revision: http://reviews.llvm.org/D11589
llvm-svn: 244743
|
|
|
|
| |
llvm-svn: 242014
|
|
|
|
|
|
| |
by pointer) from ParseArgs
llvm-svn: 240347
|
|
|
|
|
|
| |
whitespace around *)
llvm-svn: 240346
|
|
|
|
| |
llvm-svn: 240236
|
|
|
|
| |
llvm-svn: 240235
|
|
|
|
| |
llvm-svn: 239671
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D9963
llvm-svn: 238169
|
|
|
|
| |
llvm-svn: 235895
|
|
|
|
|
|
|
|
|
|
|
| |
Command line options --arm-target1-rel and --arm-target1-abs have been renamed to be compatible with GNU linkers.
Two tests have been updated:
test/elf/options/target-specific-args.test
test/elf/ARM/rel-arm-target1.test
Differential Revision: http://reviews.llvm.org/D9037
llvm-svn: 235499
|
|
|
|
|
|
|
|
|
|
|
| |
There's (almost) never need to keep .L symbols around for production
builds. In fact, the FreeBSD kernel explicitly specify -X beacuse the
size impact (and the subsequent performance impact) might be significant,
because we keep symbols in memory.
I was tempted to make this the default, but I haven't (yet).
PR: 23232
llvm-svn: 235357
|
|
|
|
|
| |
PR: 23232
llvm-svn: 235247
|
|
|
|
|
|
|
|
|
|
|
|
| |
The function took either StringRef or Twine. Since string literals are
ambiguous when resolving the overloading, many code calls used this
function with explicit type conversion. That led awkward code like
make_dynamic_error_code(Twine("Error occurred")).
This patch adds a function definition for string literals, so that
you can directly call the function with literals.
llvm-svn: 234841
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Native file format was designed to be the fastest on-memory or
on-disk file format for object files. The problem is that no one
is working on that. No LLVM tools can produce object files in
the Native, thus the feature of supporting the format is useless
in the linker.
This patch removes the Native file support. We can add it back
if we really want it in future.
llvm-svn: 234641
|
|
|
|
|
|
|
|
| |
This MIPS specific option controls R_MIPS_EH relocation handling.
If -pcrel-eh-reloc is specified R_MIPS_EH relocation should be handled
like R_MIPS_PC32 relocation.
llvm-svn: 234635
|
|
|
|
|
|
|
| |
PR: 23036
Differential Revision: http://reviews.llvm.org/D8836
llvm-svn: 234240
|
|
|
|
|
|
|
|
| |
These functions are "constructors" of the LinkingContexts. We already
have auxiliary classes and functions for ELFLinkingContext in the header.
They fall in the same category.
llvm-svn: 234082
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
What we are doing in ELFTarget.h was dubious. In the file, we define
partial classes of <Arch>LinkingContexts to declare only static member
functions. We have different (complete) class definitions in other files.
They would conflict if they exist in the same compilation unit (because
the ones defined in ELFTarget.h has only static member functions).
I don't think this was valid C++.
http://reviews.llvm.org/D8797
llvm-svn: 234039
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch provides implementation of R_ARM_TARGET1 relocation with
configuration of its behaviour from a command line. This patch provides
two command line options for GnuLd driver: --arm-target1-rel and
--arm-target1-abs (similar to ld option names with extra prefix 'arm-').
So user may choose which behaviour of R_ARM_TARGET1 is preferred for his
implementation of libc.
Differential Revision: http://reviews.llvm.org/D8707
llvm-svn: 234009
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit implements the behaviour of the SECTIONS linker script directive,
used to not only define a custom mapping between input and output sections, but
also order input sections in the output file. To do this, we modify
DefaultLayout with hooks at important places that allow us to re-order input
sections according to a custom order. We also add a hook in SegmentChunk to
allow us to calculate linker script expressions while assigning virtual
addresses to the input sections that live in a segment.
Not all SECTIONS constructs are currently supported, but only the ones that do
not use special sort orders. It adds two LIT test as practical examples of
which sections directives are currently supported.
In terms of high-level changes, it creates a new class "script::Sema" that owns
all linker script ASTs and the logic for linker script semantics as well.
ELFLinkingContext owns a single copy of Sema, which will be used throughout
the object file writing process (to layout sections as proposed by the linker
script).
Other high-level change is that the writer no longer uses a "const" copy of
the linking context. This happens because linker script expressions must be
calculated *while* calculating final virtual addresses, which is a very late
step in object file writing. While calculating these expressions, we need to
update the linker script symbol table (inside the semantics object), and, thus,
we are "modifying our context" as we prepare to write the file.
http://reviews.llvm.org/D8157
llvm-svn: 232402
|
|
|
|
|
|
|
|
|
|
|
| |
GNU LD has an option named -T/--script which allows a user to specify
a linker script to be used [1]. LLD already accepts linker scripts
without this option, but the option is widely used. Therefore it is
best to support it in LLD as well.
[1] https://sourceware.org/binutils/docs/ld/Options.html#Options
llvm-svn: 232183
|
|
|
|
|
|
| |
This patch implements evaluation of the GNU ld EXTERN command.
llvm-svn: 232111
|
|
|
|
|
|
|
|
|
| |
User should be able to override default search paths using the -L
option.
http://reviews.llvm.org/D7902
llvm-svn: 230679
|
|
|
|
| |
llvm-svn: 230594
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is mainly for back-compatibility with GNU ld.
Ideally --stats should be a general option in LinkingContext, providing
individual stats for every pass in the linking process.
In the GNU driver, a better wording could be used, but there's no need
to change it for now.
Differential Revision: D7657
Reviewed by: ruiu
llvm-svn: 230157
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use a wrapper function for symbol. Any undefined reference to symbol will be
resolved to "__wrap_symbol". Any undefined reference to "__real_symbol" will be
resolved to symbol.
This can be used to provide a wrapper for a system function. The wrapper
function should be called "__wrap_symbol". If it wishes to call the system
function, it should call "__real_symbol".
Here is a trivial example:
void * __wrap_malloc (size_t c)
{
printf ("malloc called with %zu\n", c);
return __real_malloc (c);
}
If you link other code with this file using --wrap malloc, then all calls
to "malloc" will call the function "__wrap_malloc" instead. The call to
"__real_malloc" in "__wrap_malloc" will call the real "malloc" function.
llvm-svn: 228906
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds the LinkingContext parameter to the ELFReader. Previously the flags in
that were needed in the Context was passed to the ELFReader, this made it very
hard to access data structures in the LinkingContext when reading an ELF file.
This change makes the ELFReader more flexible so that required parameters can be
grabbed directly from the LinkingContext.
Future patches make use of the changes.
There is no change in functionality though.
llvm-svn: 228905
|
|
|
|
| |
llvm-svn: 228753
|
|
|
|
| |
llvm-svn: 228749
|
|
|
|
| |
llvm-svn: 228743
|
|
|
|
|
|
|
| |
This local variable name did not follow the style guide,
and it is not actually needed.
llvm-svn: 228722
|
|
|
|
|
|
|
| |
Differential Revision: D7489
Reviewed by: shankarke
llvm-svn: 228533
|
|
|
|
|
|
|
| |
It looks like the Driver manages search path for each Target lld would support
on the Gnu flavor.
llvm-svn: 228440
|
|
|
|
|
|
| |
No change in functionality.
llvm-svn: 228379
|
|
|
|
|
|
|
|
|
| |
Only search library directories explicitly specified
on the command line. Library directories specified in linker
scripts (including linker scripts specified on the command
line) are ignored.
llvm-svn: 228375
|
|
|
|
|
|
|
|
|
|
| |
INPUT directive is a variant of GROUP in the sense that that specifies
a list of input files. The only difference is whether the entire file
list is wrapped with a --start-group/--end-group or not.
http://reviews.llvm.org/D7390
llvm-svn: 228060
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, no one owns script::Parser buffers, but yet ELFLinkingContext gets
updated with StringRef pointers to data inside Parser buffers. Since this buffer
is locally owned inside GnuLdDriver::evalLinkerScript(), as soon as this
function finishes, all pointers in ELFLinkingContext that comes from linker
scripts get invalid. The problem is that we need someone to own linker scripts
data structures and, since ELFLinkingContext transports references to linker
scripts data, we can simply make it also own all linker scripts data.
Differential Revision: http://reviews.llvm.org/D7323
llvm-svn: 227975
|
|
|
|
|
|
|
| |
This patch is to enable to write unit tests for linker script with
less boilerplate code.
llvm-svn: 227902
|
|
|
|
|
|
| |
Reviewed by: ruiu, shankarke
llvm-svn: 227787
|
|
|
|
|
|
|
|
| |
Target specific LinkingContext's determine the default search directory.
No change in functionality.
llvm-svn: 227784
|
|
|
|
|
|
| |
Reviewed by: shankarke, ruiu
llvm-svn: 227708
|