| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 230726
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Nothing wrong with reinterpret_cast<llvm::support::ulittle32_t *>(loc),
but that's redundant and not great from readability point of view.
The new functions are wrappers for that kind of reinterpet_casts.
Surprisingly or unsurprisingly, there was no use of big endian read
and write. {read,write}{16,32,64}be have no user. But I think they
still worth to be there in the header for completeness.
http://reviews.llvm.org/D7927
llvm-svn: 230725
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we have a string -> string map to keep the weak alias
symbol mapping. Naturally we can't define more than one weak alias
with that data structure.
This patch is to allow multiple aliases for the same symbol by
changing the map type to string -> set of string map.
llvm-svn: 230702
|
|
|
|
| |
llvm-svn: 230687
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 230678
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 230677
|
|
|
|
| |
llvm-svn: 230594
|
|
|
|
| |
llvm-svn: 230593
|
|
|
|
| |
llvm-svn: 230578
|
|
|
|
| |
llvm-svn: 230574
|
|
|
|
|
|
|
| |
Differential Revision: D7820
Reviewed by: shankarke, ruiu
llvm-svn: 230465
|
|
|
|
|
|
|
|
|
|
|
| |
In LLD's model, symbol is a property of the node (atom) and not a property of
edge (reference). Prior to this patch, we stored the symbol in the reference.
From post-commit comments, it seemed better to create a map from the reference
to the symbol instead and use this mapping wherever desired.
Address comments from Ruiu/Simon Atanasyan.
llvm-svn: 230273
|
|
|
|
|
|
| |
Cleanup.
llvm-svn: 230219
|
|
|
|
|
|
| |
Address review comments from Ruiu, and add some more TODO's.
llvm-svn: 230218
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SHF_GROUP: Group Member Sections
----------------------------------
A section which is part of a group, and is to be retained or discarded with the
group as a whole, is identified by a new section header attribute: SHF_GROUP
This section is a member (perhaps the only one) of a group of sections, and the
linker should retain or discard all or none of the members. This section must be
referenced in a SHT_GROUP section. This attribute flag may be set in any section
header, and no other modification or indication is made in the grouped sections.
All additional information is contained in the associated SHT_GROUP section.
SHT_GROUP: Section Group Definition
-------------------------------------
Represents a group section.
The section group's sh_link field identifies a symbol table section, and its
sh_info field the index of a symbol in that section. The name of that symbol is
treated as the identifier of the section group.
More information: https://mentorembedded.github.io/cxx-abi/abi/prop-72-comdat.html
Added a lot of extensive tests, that tests functionality.
llvm-svn: 230195
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the GNU linker sees two input sections with the same name, and the name
starts with ".gnu.linkonce.", the linker will only keep one copy and discard the
other. Any section whose name starts with “.gnu.linkonce.” is a COMDAT section.
Some architectures like Hexagon use this section to store floating point constants,
that need be deduped.
This patch adds gnu.linkonce functionality to the ELFReader.
llvm-svn: 230194
|
|
|
|
| |
llvm-svn: 230192
|
|
|
|
|
|
|
|
|
| |
Relocation handling need more information about the Symbol that we are creating
references for.
No change in functionality.
llvm-svn: 230191
|
|
|
|
|
|
|
|
|
| |
There is code(added by me) in the YAMLReader which isn't correct when it handles references
for section groups. The test case was also checking for wrong outputs.
This fixes the bug and the testcase so that they check for proper outputs.
llvm-svn: 230190
|
|
|
|
| |
llvm-svn: 230189
|
|
|
|
| |
llvm-svn: 230166
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
FIXME code was left around in few places where its already been taken care of.
This removes the FIXME's that are not needed.
llvm-svn: 230139
|
|
|
|
|
|
|
|
|
| |
Now since the correct file path for atoms is available and not clobbered,
commit r222309 which was reverted previously can be added back.
No change in functionality.
llvm-svn: 230138
|
|
|
|
|
|
|
|
| |
The ELFReader was skipping references for sections that contained relocations.
This fixes the bug.
llvm-svn: 230127
|
|
|
|
|
|
|
|
|
|
|
|
| |
Looks like there's a threading issue in the COFF reader which makes
buildbot unstable. Probability of crash varies depending on the number
of input. If we are linking a big executalbe, LLD almost always crash.
This patch temporarily adds a lock to guard the reader so that LLD
doesn't crash. I'll investigate and fix the issue as soon as possible
because this patch has negative performance impact.
llvm-svn: 230086
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The round-trip passes were introduced in r193300. The intention of
the change was to make sure that LLD is capable of reading end
writing such file formats.
But that turned out to be yet another over-designed stuff that had
been slowing down everyday development.
The passes ran after the core linker and before the writer. If you
had an additional piece of information that needs to be passed from
front-end to the writer, you had to invent a way to save the data to
YAML/Native. These passes forced us to do that even if that data
was not needed to be represented neither in an object file nor in
an executable/DSO. It doesn't make sense. We don't need these passes.
http://reviews.llvm.org/D7480
llvm-svn: 230069
|
|
|
|
| |
llvm-svn: 230007
|
|
|
|
|
|
|
|
|
|
|
| |
LinkerScript AST nodes are never destroyed which means that their
std::vector members will never be destroyed.
Instead, allocate the operand list itself in the Parser's
BumpPtrAllocator. This ensures that the storage will be destroyed along
with the nodes when the Parser is destroyed.
llvm-svn: 229967
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is yet another edge case of base relocation for symbols. Absolute
symbols are in general not target of base relocation because absolute
atom is a way to point to a specific memory location. In r229816, I
removed entries for absolute atoms from the base relocation table
(so that they won't be fixed by the loader).
However, there was one exception -- ImageBase. ImageBase points to the
start address of the current image in memory. That needs to be fixed up
at load time. This patch is to treat the symbol in a special manner.
llvm-svn: 229961
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D7733
llvm-svn: 229912
|
|
|
|
|
|
|
| |
Typename shouldn't mix camel case and underscore.
Thanks to Rui for the remark.
llvm-svn: 229848
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we wrongly emitted a base relocation entry for an absolute symbol.
That made the loader to rewrite some instruction operands with wrong values
only when a DLL is not loaded at the default address. That caused a
misterious crash of some executable.
Absolute symbols will of course never change value wherever the binary is
loaded to memory. We shouldn't emit base relocations for absolute symbols.
llvm-svn: 229816
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Weak aliases defined using /alternatename command line option were getting
wrong RVAs in the final output because of wrong atom ordinal. Alias atoms
were assigned large ordinals than any other regular atoms because they were
instantiated after other atoms and just got new (larger) ordinals.
Atoms are sorted by its file and atom ordinals in the order pass. Alias
atoms were located after all other atoms in the same file.
An alias atom's ordinal needs to be smaller than its alias target but larger
than the atom appeared before the target -- so that the alias is located
between the two. Since an alias has no size, the alias target will be located
at the same location as the alias.
In this patch, I made a gap between two regular atoms so that we can put
aliases after instantiating them (without re-numbering existing atoms).
llvm-svn: 229762
|
|
|
|
|
|
|
|
|
| |
atomContent's memory is freed at the end of the stack frame,
but it is referenced by the atom pushed into _definedAtoms.
Differential Revision: http://reviews.llvm.org/D7732
llvm-svn: 229749
|
|
|
|
|
|
|
| |
Differential Revision: D7693
Reviewed by: shankarke
llvm-svn: 229635
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 229453
|
|
|
|
| |
llvm-svn: 229442
|
|
|
|
| |
llvm-svn: 229441
|
|
|
|
|
|
|
|
| |
separate functions
No functional changes.
llvm-svn: 229440
|
|
|
|
|
|
| |
pointer from this capture-less lambda. NFC.
llvm-svn: 229426
|
|
|
|
|
|
| |
Define an explicit type for arch specific reference kinds to make sure all cases are covered in switch statements.
llvm-svn: 229314
|
|
|
|
| |
llvm-svn: 229249
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Define an explicit type for arch specific reference kind and use it in switch statement to make the compiler emit warnings if some case is not cover.
It will help to catch such errors when we add new mach-o reference kind.
Reviewers: shankarke, kledzik
Reviewed By: shankarke
Subscribers: shankarke, aemerson, llvm-commits
Projects: #lld
Differential Revision: http://reviews.llvm.org/D7612
llvm-svn: 229246
|
|
|
|
|
|
|
|
|
| |
Wrap functionality was using a std::set to record symbols that need to be
wrapped. This changes the implementation to use a StringSet instead.
No change in functionality.
llvm-svn: 229165
|
|
|
|
| |
llvm-svn: 229109
|
|
|
|
| |
llvm-svn: 229107
|
|
|
|
|
|
|
| |
Add support for checking overflow when applying a R_AARCH64_ABS32
relocation and add a test to ensure it behaves correctly.
llvm-svn: 229072
|
|
|
|
| |
llvm-svn: 229055
|
|
|
|
| |
llvm-svn: 229030
|