When doing a relocatable link the .ARM.exidx sections with the
SHF_LINK_ORDER flag set need to set the sh_link field to the executable
section they describe. We find the appropriate OutputSection by
following the sh_link field of the .ARM.exidx InputSections.
The getOutputSectionName() function rules make sure that when there are
multiple .ARM.exidx InputSections in an OutputSection they all have the
same sh_link field.
Differential revision: https://reviews.llvm.org/D25825
llvm-svn: 284820
rL284708 introduces a link error when building with BUILD_SHARED_LIBS:
undefined reference to `llvm::DWARFContext::parseCompileUnits()'
undefined reference to `llvm::DWARFContextInMemory::DWARFContextInMemory(
llvm::object::ObjectFile const&,
llvm::LoadedObjectInfo const*)'
The functions are available in libDebugInfoDWARF, from llvm.
Patch by Visoiu Mistrih Francis
Differential revision: https://reviews.llvm.org/D25843
llvm-svn: 284810
Some MIPS relocations used to access GOT entries are able to manipulate
16-bit index. The other ones like R_MIPS_CALL_HI16/LO16 can handle
32-bit indexes. 16-bit relocations are generated by default. The 32-bit
relocations are generated by -mxgot flag passed to compiler. Usually
these relocation are not mixed in the same code but files like crt*.o
contain 16-bit relocations so even if all "user's" code compiled with
-mxgot flag a few 16-bit relocations might come to the linking phase.
Now LLD does not differentiate local GOT entries accessed via a 16-bit
and 32-bit indexes. That might lead to relocation's overflow if 16-bit
entries are allocated to far from the beginning of the GOT.
The patch introduces new "part" of MIPS GOT dedicated to the local GOT
entries accessed by 32-bit relocations. That allows to put local GOT
entries accessed via a 16-bit index first and escape relocation's overflow.
Differential revision: https://reviews.llvm.org/D25833
llvm-svn: 284809
In-memory ELF object files created here are consumed immediately,
so as long as the generated files are syntactically correct, we don't
care about the details.
llvm-svn: 284803
Summary:
The rules for quoting the command line that a subprocess receives are
user space conventions implemented by the C runtime. Python's quoting
rules are implemented here:
c30098c8c6/Lib/subprocess.py (L725)
The result is that the final command line C string computed by Python is
'echo \"'. Mingw doesn't appear to interpret that backslash as escaping
the quote because it is not already inside a quoted region. As a result,
our echo command prints a single backslash instead of a quote.
The whole issue can be sidestepped by adding a space a forcing Python to
put the argument to echo in double quotes.
Reviewers: inglorion, ruiu
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D25841
llvm-svn: 284768
This is needed for the following case (OpenCL example):
__global int Var = 0;
__global int* Ptr[] = {&Var};
...
Differential Revision: https://reviews.llvm.org/D25815
llvm-svn: 284764
MIPS GOT consists of some parts: local, global, TLS entries. This change
separates calculation of MIPS GOT index and offset of the corresponding
part of the GOT. That makes code a bit clear and allow to extend number
of parts in the future.
llvm-svn: 284750
Builds were failing with:
InputSection.h(139): error C2338: SectionPiece is too big
because MSVC does record layout differently, probably not packing the
'OutputOff' and 'Live' bitfields because their types are of different
size. Using size_t for 'Live' seems to fix it.
llvm-svn: 284740
The R_ARM_PREL31 and R_ARM_NONE relocations should not be faulted in
shared libraries. In the case of R_ARM_NONE, we have moved the TLS
relaxation hint instruction to R_TLSDESC_CALL so that R_HINT can be used
without side-effects. In the case of R_ARM_PREL31 we permit it to be used
against PLT entries as the personality routines are imported when used in
shared libraries.
Differential Revision: https://reviews.llvm.org/D25721
llvm-svn: 284710
This script below shouldn't include file and program headers
to PT_LOAD segment, because it doesn't have PHDRS and FILEHDR
attributes:
PHDRS { all PT_LOAD; }
SECTIONS { /* list of sections here */ }
Differential revision: https://reviews.llvm.org/D25774
llvm-svn: 284709
In this patch partial gdb_index section is created.
For costructing the .gdb_index section 6 steps should be performed (details are in
SplitDebugInfo.cpp file header), this patch do first 3:
Creates proper section header.
Fills list of compilation units.
Types CU list area is not supposed to be supported, so it is ignored and therefore
can be treated as implemented either.
Differential revision: https://reviews.llvm.org/D24706
llvm-svn: 284708
-format=<foo>, -format <foo> and -b <foo> are all the same.
Previous code was intended to produce an error message with the
same spelling as given from the command line, but it actually
always printed out this string: "unknown -format= value:".
This is probably more confusing than "unknown -format value:".
So I changed the message.
llvm-svn: 284693
Use size_t instead of ELFT::uint for the string table offset. If the
linker is built 32-bit, it can't write an output file larger than 2GB.
Other code in this area uses size_t as well.
llvm-svn: 284680
Previously, we were checking the existence of an entry symbol
too early. It was done before the linker script processor creates
symbols defined in scripts. Fixes bug 30743.
llvm-svn: 284676