16182 Commits

Author SHA1 Message Date
Amy Kwan
2b3336fa54 [PowerPC][lld] Account for additional X-Forms -> D-Form/DS-Forms load/stores when relaxing initial-exec to local-exec
D153645 added additional X-Form load/stores that can be generated for TLS accesses.
However, these added instructions have not been accounted for in lld. As a result,
lld does not know how to handle them and cannot relax initial-exec to local-exec
when the initial-exec sequence contains these additional load/stores.

This patch aims to resolve https://github.com/llvm/llvm-project/issues/64424.

Differential Revision: https://reviews.llvm.org/D158197

(cherry picked from commit 698b45aa902de4d30c798e8d6bd080c8e31bade8)
2023-09-01 08:23:17 +02:00
Weining Lu
7fc3c153a8 [lld][LoongArch] Support the R_LARCH_PCREL20_S2 relocation type
`R_LARCH_PCREL20_S2` is a new added relocation type in LoongArch ELF
psABI v2.10 [1] which is not corvered by D138135 except `R_LARCH_64_PCREL`.

A motivation to support `R_LARCH_PCREL20_S2` in lld is to build the
runtime of .NET core (a.k.a `CoreCLR`) in which strict PC-relative
semantics need to be guaranteed [2]. The normal `pcalau12i + addi.d`
approach doesn't work because the code will be copied to other places
with different "page" and offsets. To achieve this, we can use `pcaddi`
with explicit `R_LARCH_PCREL20_S2` reloc to address +-2MB PC-relative
range with 4-bytes aligned.

[1]: https://github.com/loongson/la-abi-specs/releases/tag/v2.10
[2]: https://github.com/dotnet/runtime/blob/release/7.0/src/coreclr/vm/loongarch64/asmhelpers.S#L307

Reviewed By: xen0n, MaskRay

Differential Revision: https://reviews.llvm.org/D156772

(cherry picked from commit 8a31f7ddb8436fa2a8ad754eb51618139cf63415)
2023-08-11 09:00:47 +02:00
Martin Storsjö
08f4f4c2d6 [docs] Add release notes for a Windows specific change in LLD 2023-07-31 09:15:57 +02:00
WANG Xuerui
02ccc2a8ff [lld][ELF][test] Fix excessive output file size in loongarch-add-sub.s
Initially the .rodata section came before .text, hence sharing its
segment with the program header sitting at a small offset, pushing the
output file size to ~72GiB (the file was sparse though, so not much is
really written). This breaks on 32-bit platforms and is irrelevant to
the feature being tested, so re-order the two sections so .text gets
processed first, and both sections get their own segment.

This addresses the issue found by the clang-armv8-lld-2stage builder:
    https://lab.llvm.org/buildbot/#/builders/178/builds/5340

Reviewed By: SixWeining, xry111

Differential Revision: https://reviews.llvm.org/D156293

(cherry picked from commit ffe2b6f75de55b665520669059c3d95240482d54)
2023-07-27 15:36:55 +02:00
WANG Xuerui
6084ee7420 [lld][ELF] Support LoongArch
This adds support for the LoongArch ELF psABI v2.00 [1] relocation
model to LLD. The deprecated stack-machine-based psABI v1 relocs are not
supported.

The code is tested by successfully bootstrapping a Gentoo/LoongArch
stage3, complete with common GNU userland tools and both the LLVM and
GNU toolchains (GNU toolchain is present only for building glibc,
LLVM+Clang+LLD are used for the rest). Large programs like QEMU are
tested to work as well.

[1]: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html

Reviewed By: MaskRay, SixWeining

Differential Revision: https://reviews.llvm.org/D138135
2023-07-25 17:06:07 +08:00
Fangrui Song
fb2a971c01 [Support] Change MapVector's default template parameter to SmallVector<*, 0>
SmallVector<*, 0> is often a better replacement for std::vector :
both the object size and the code size are smaller.
(SmallMapVector uses SmallVector as well, but it is not common.)

clang size decreases by 0.0226%.
instructions:u decreases 0.037% when compiling a sqlite3 amalgram.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D156016
2023-07-24 22:04:03 -07:00
Fangrui Song
760cad6926 ReleaseNotes: add lld/ELF notes 2023-07-23 15:06:33 -07:00
Fangrui Song
8db61ed29d [WebAssembly] Stabilize custom section order
It currently depends on the StringMap iteration order, which is not
guaranteed to be deterministic. Use MapVector to stabilize the order.
2023-07-22 09:37:22 -07:00
Aaron Ballman
29112a9946 Mark this test as unsupported on Windows systems
There is a strange issue happening with command line processing though. The
command line argument
   --export-dynamic-symbol 'f*'
does not have the single quotes stripped on some Windows targets (but not
all). This causes the glob matching to fail, which means the test fails on
some Windows bots and passes on others.

This is expected to be a temporary measure to get bots back to green. I've not
found a commit that has caused a behavioral change that could be reverted
instead, so this could be an issue with lit or test machine configuration.
2023-07-21 08:10:52 -04:00
Fangrui Song
a3622ac80b [wasm-ld] Switch to xxh3_64bits
Similar to recent changes to ELF (e.g., D154813), Mach-O, and COFF to
improve hashing performance.

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D155752
2023-07-20 10:47:47 -07:00
Fangrui Song
82b4368f7f [llvm-readobj] Print <null> for relocation target with an empty name
For a relocation, we don't differentiate the two cases:

* the symbol index is 0
* the symbol index is non zero, the type is not STT_SECTION, and the name is empty. Clang generates such local symbols for RISC-V linker relaxation.

So we may print
```
    Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
000000000000001c  0000000100000039 R_RISCV_32_PCREL       0000000000000000 0

// llvm-readobj
0x1C R_RISCV_32_PCREL - 0x0
```

while GNU readelf prints "<null>", which is clearer. Let's match the GNU behavior.
Related to https://reviews.llvm.org/D81842

```
000000000000001c  0000000100000039 R_RISCV_32_PCREL       0000000000000000 <null> + 0

// llvm-readobj
0x1C R_RISCV_32_PCREL <null> 0x0
```

Reviewed By: jhenderson, kito-cheng

Differential Revision: https://reviews.llvm.org/D155353
2023-07-20 00:42:38 -07:00
Paul Kirth
1733d94963 Revert "[lld] Preliminary fat-lto-object support"
This reverts commit c9953d9891a6067549a78e7d07ca8eb6a7596792 and a
forward fix in 3a45b843dec1bca195884aa1c5bc56bd0e6755b4.

D14677 causes some failure on windows bots that the forward fix did not
address. Thus I'm reverting until the underlying cause can me triaged.
2023-07-20 03:37:48 +00:00
Fangrui Song
c9953d9891 [ELF][test] Add REQUIRES: x86 after D146778 2023-07-19 18:17:46 -07:00
Fangrui Song
359f170f5f [lld-macho] Use fixed chunk size for UUID
Chunk size decided by the thread count makes the UUID less deterministic
(e.g. across machines with different core counts.)
Follow ELF and just use a fixed chunksize.

Fixes: https://github.com/llvm/llvm-project/issues/63961

Reviewed By: #lld-macho, keith

Differential Revision: https://reviews.llvm.org/D155761
2023-07-19 17:24:36 -07:00
Keith Smiley
f317ce218e
[lld-macho] Implement -no_uuid
Since UUID generation in lld is fast this is rarely used but it can be
helpful to avoid temporary issues like https://github.com/llvm/llvm-project/issues/63961

Differential Revision: https://reviews.llvm.org/D155735
2023-07-19 16:39:31 -07:00
Paul Kirth
3a45b843de [lld] Preliminary fat-lto-object support
This patch adds support to lld for --fat-lto-objects. We add a new
--fat-lto-objects flag to LLD, and slightly change how it chooses input
files in the driver when the flag is set.

Fat LTO objects contain both LTO compatible IR, as well as generated object
code. This allows users to defer the choice of whether to use LTO or not to
link-time. This is a feature available in GCC for some time, and makes the
existing -ffat-lto-objects flag functional in the same way as GCC's.

If the --fat-lto-objects option is passed to LLD and the input files are fat
object files, then the linker will chose the LTO compatible bitcode sections
embedded within the fat object and link them together using LTO. Otherwise,
standard object file linking is done using the assembly section in the object
files.

Original RFC: https://discourse.llvm.org/t/rfc-ffat-lto-objects-support/63977

Depends on D146777

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D146778
2023-07-19 23:07:42 +00:00
Fangrui Song
1d1f245270 [COFF] Switch to xxh3_64bits
Similar to recent changes to ELF (e.g., commit
f4b4bc2f18dc0e44afde05735fb673d3de4d5c39) and Mach-O to improve hashing
performance.
2023-07-19 14:08:14 -07:00
Fangrui Song
a290db3af1 [ELF] --build-id=fast: switch to xxh3_64bits 2023-07-19 11:37:42 -07:00
Fangrui Song
eabaf3ba85 [ELF] splitNonStrings: switch to xxh3_64bits
This is primarily used for .rodata.cst* duplicate elimination. The
sections are usually much smaller than .debug_str (D154813), so the
speedup is negligible. We do this switch for consistency as we want to
eliminate xxh64 in lld.
2023-07-19 11:28:47 -07:00
Vy Nguyen
642ffbbf38 [lld-macho]Use install_name as Identifier for code-sign, if available.
Detail:
LD64 uses the name provided via  -[dylib]install_name as "Identifier", when available.
For compatiblity, LLD should do that too.

Differential Revision: https://reviews.llvm.org/D155508
2023-07-19 14:19:15 -04:00
Fangrui Song
b69d4a4fb7 [ELF][test] Refactor merge.s 2023-07-19 11:13:26 -07:00
Fangrui Song
2090d66b23 [lld-macho] Switch to xxh3_64bits
xxh3 is substantially faster than xxh64.
For lld/ELF, there is substantial speedup in `.debug_str` duplicate
elimination (D154813). Use xxh3 for lld-macho as well.

Reviewed By: #lld-macho, oontvoo

Differential Revision: https://reviews.llvm.org/D155677
2023-07-19 09:58:44 -07:00
Fangrui Song
4f60815114 [ELF] Use llvm::xxh3_64bits for MergeInputSection::splitStrings
See D154812 for the speedup.

Reviewed By: PiotrZSL

Differential Revision: https://reviews.llvm.org/D154813
2023-07-19 08:34:26 -07:00
Fangrui Song
f4b4bc2f18 [ELF] --icf: switch to xxh3_64bits
for more efficient section content hashing. Also clean up the tests a
bit and properly test the formatting of --print-icf-sections.
2023-07-18 17:57:31 -07:00
Matthew Voss
ab9b3c84a5 [lld] A Unified LTO Bitcode Frontend
The unified LTO pipeline creates a single LTO bitcode structure that can
be used by Thin or Full LTO. This means that the LTO mode can be chosen
at link time and that all LTO bitcode produced by the pipeline is
compatible, from an optimization perspective. This makes the behavior of
LTO a bit more predictable by normalizing the set of LTO features
supported by each LTO bitcode file.

Example usage:

clang -flto -funified-lto -fuse-ld=lld foo.c

clang -flto=thin -funified-lto -fuse-ld=lld foo.c

clang -c -flto -funified-lto foo.c  # -flto={full,thin} are identical in
terms of compilation actions
clang -flto=thin -fuse-ld=lld foo.o # pass --lto=thin to ld.lld

clang -c -flto -funified-lto foo.c clang -flto -fuse-ld=lld foo.o

The RFC discussing the details and rational for this change is here:
https://discourse.llvm.org/t/rfc-a-unified-lto-bitcode-frontend/61774

Differential Revision: https://reviews.llvm.org/D123805
2023-07-18 16:13:58 -07:00
Fangrui Song
6a00e70976 [lld][test] Remove unused features
"system-linker-elf" and "demangler" have been unused since
lld/test/old-elf/ was removed in 2016.
2023-07-18 00:28:17 -07:00
Fangrui Song
fae96104d4 [ELF] Support operator ^ and ^=
GNU ld added ^ support in July 2023 and it looks like ^= is in plan as
well.

For now, we don't support `a^=0` (^= without a preceding space).
2023-07-15 14:10:40 -07:00
Tobias Hieta
af744f0b84 [LLD][COFF] Add LLVM toolchain library paths by default.
We want lld-link to automatically find compiler-rt's and
libc++ when it's in the same directory as the rest of the
toolchain. This is because on Windows linking isn't done
via the clang driver - but instead invoked directly.

This prepends: <llvm>/lib <llvm>/lib/clang/XX/lib and
<llvm>/lib/clang/XX/lib/windows automatically to the library
search paths.

Related to #63827

Differential Revision: https://reviews.llvm.org/D151188
2023-07-14 14:37:24 +02:00
Tobias Hieta
b6c2f100c2 [lld][COFF] Find libraries with relative paths.
This patch is spun out of https://reviews.llvm.org/D151188
and makes it possible for lld-link to find libraries with
relative paths. This will be used later to implement the
changes to autolinking runtimes explained in #63827

Differential Revision: https://reviews.llvm.org/D155268
2023-07-14 12:09:26 +02:00
Tobias Hieta
33f93425dd [lld][COFF] Add -print-search-paths for debugging.
While working on adding more implicit search paths to the
lld COFF driver, it was helpful to have a way to print all
the search paths, both for debugging and for testing without
having to create very complicated test cases.

This is a simple arg that just prints the search paths and exits.

Related to the efforts in #63827

Differential Revision: https://reviews.llvm.org/D155047
2023-07-13 10:52:57 +02:00
Brendan Dahl
220fe00a7c [WebAssembly] Support annotate clang attributes for marking functions.
Annotation attributes may be attached to a function to mark it with
custom data that will be contained in the final Wasm file. The
annotation causes a custom section named
"func_attr.annotate.<name>.<arg0>.<arg1>..." to be created that will
contain each function's index value that was marked with the annotation.

A new patchable relocation type for function indexes had to be created so
the custom section could be updated during linking.

Reviewed By: sbc100

Differential Revision: https://reviews.llvm.org/D150803
2023-07-11 15:17:26 -07:00
Martin Storsjö
6daa4b90e2 [LLD] [COFF] Warn about pseudo relocations that are too narrow
In 64 bit mode, any references to symbols that might end up autoimported
must be made via full 64 bit pointers (usually in .refptr stubs
generated by the compiler).

If referenced via e.g. a 32 bit rip relative offset, it might work
as long as DLLs are loaded close together in the 64 bit address
space, but will fail surprisingly later if they happen to be loaded
further apart. Any cases of that happening is usually a toolchain
error, and the sooner we can warn about it, the easier it is to diagnose.

Differential Revision: https://reviews.llvm.org/D154777
2023-07-11 23:43:34 +03:00
Alex Brachet
67a212af4c [ELF] Make subsequent opens to auxiliary files append
Previously, the same file could be used across diagnostic options but
the file would be silently overwritten by the whichever option gets
handled last.

Differential Revision: https://reviews.llvm.org/D153873
2023-07-11 11:08:57 +00:00
Fangrui Song
b7d36a1a1e [ELF] Use compression::getReasonIfUnsupported for zlib/zstd unavailable error
The error message now matches llvm-objcopy --compress-debug-sections=[zlib|zstd].
2023-07-06 10:31:45 -07:00
Konrad Kleine
58fb2c7a6c [lld] respect LLVM_EXTERNAL_LIT
Consider a setup without a system-wide installation of lit.
Instead you pass the path to lit like this:

```
cmake ...
-DLLVM_EXTERNAL_LIT=<PATH_TO_LIT_BINARY> ...
```

Then you will run into this error:

```
ninja: error: unknown target 'check-lld'
```

I have a buildbot builder that fails with this message. Here's the
passage that triggers this error:

d3bfd5ccbc/zorg/buildbot/builders/annotated/standalone-build.sh (L194-L239)

By using `LLVM_EXTERNAL_LIT` instead of `LLVM_LIT` we fix this problem.

See
[here](https://llvm.org/docs/GettingStarted.html#stand-alone-builds) for
a description:

> Both the LLVM_ROOT and LLVM_EXTERNAL_LIT options are required to do stand-alone builds for all sub-projects. Additional required options for each sub-project can be found in the table below.

Differential Revision: https://reviews.llvm.org/D154599
2023-07-06 16:35:01 +02:00
Amilendra Kodithuwakku
9acbab60e5 [LLD][ELF] Cortex-M Security Extensions (CMSE) Support
This commit provides linker support for Cortex-M Security Extensions (CMSE).
The specification for this feature can be found in ARM v8-M Security Extensions:
Requirements on Development Tools.

The linker synthesizes a security gateway veneer in a special section;
`.gnu.sgstubs`, when it finds non-local symbols `__acle_se_<entry>` and `<entry>`,
defined relative to the same text section and having the same address. The
address of `<entry>` is retargeted to the starting address of the
linker-synthesized security gateway veneer in section `.gnu.sgstubs`.

In summary, the linker translates input:

```
    .text
  entry:
  __acle_se_entry:
    [entry_code]

```
into:

```
    .section .gnu.sgstubs
  entry:
    SG
    B.W __acle_se_entry

    .text
  __acle_se_entry:
    [entry_code]
```

If addresses of `__acle_se_<entry>` and `<entry>` are not equal, the linker
considers that `<entry>` already defines a secure gateway veneer so does not
synthesize one.

If `--out-implib=<out.lib>` is specified, the linker writes the list of secure
gateway veneers into a CMSE import library `<out.lib>`. The CMSE import library
will have 3 sections: `.symtab`, `.strtab`, `.shstrtab`. For every secure gateway
veneer <entry> at address `<addr>`, `.symtab` contains a `SHN_ABS` symbol `<entry>` with
value `<addr>`.

If `--in-implib=<in.lib>` is specified, the linker reads the existing CMSE import
library `<in.lib>` and preserves the entry function addresses in the resulting
executable and new import library.

Reviewed By: MaskRay, peter.smith

Differential Revision: https://reviews.llvm.org/D139092
2023-07-06 11:34:07 +01:00
Fangrui Song
49dfbc6efc [ELF] Remove one unneeded unquote from D124266
This one is unneeded after commit d60ef9338deb734541ff1c9d0771807815d5d9e6 (2023-02-03).
2023-07-05 15:08:53 -07:00
Roger Pau Monne
7cab385a8f [lld/elf] support quote usage in section names
Section names used in ELF linker scripts can be quoted, but such
quotes must not be propagated to the binary ELF section names.  As
such strip the quotes from the section names when processing them, and
also strip them from linker script functions that take section names
as parameters.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D124266
2023-07-05 14:56:16 -07:00
Haohai Wen
2a631a8fed [lld/COFF] Add /dwodir to enable DWARF fission with LTO
This patch added /dwodir to lld/COFF which is equivalent to lld/ELF
option -plugin-opt=dwo_dir=. This option tells LTO backend to create
dwo directory and files and all dwo files will be in it. Otherwise all
dwarf sections will be embeded into image even if -gsplit-dwarf is
specified when using LTO.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D154070
2023-07-01 08:59:12 +08:00
Keith Walker
5c42ba9837 [ARM] armv6m eXecute Only (XO) long branch Thunk
This patch adds a thunk for Thumb long branch on V6-M for eXecute Only.

Note that there is currently no support for a position independant and
eXecute Only V6-M long branch thunk

Differential Revision: https://reviews.llvm.org/D153772
2023-06-30 11:56:41 +01:00
Daniel Kiss
92fbb602f3 [lld][AArch64] Add BTI landing pad to PLT entries when the symbol is exported.
With relative vtables the caller jumps directly to the plt entries in the shared object,
therefore landing pad is need for these entries.

Reproducer:
main.cpp
```
#include "v.hpp"
int main() {
    A* a = new B();
    a->do_something2();
    return 0;
}
```
v.hpp
```
struct A {
    virtual void do_something() = 0;
    virtual void do_something2();
};
struct B : public A {
    void do_something() override;
    void do_something2() override;
};
```
v.cpp
```
#include "v.hpp"
void A::do_something2() { }
void B::do_something() { }
void B::do_something2() { }
```
```
CC="clang++ --target=aarch64-unknown-linux-gnu -fuse-ld=lld -mbranch-protection=bti"
F=-fexperimental-relative-c++-abi-vtables
${=CC} $F -shared v.cpp -o v.so -z force-bti
${=CC} $F main.cpp -L./ v.so -Wl,-rpath=. -z force-bti
qemu-aarch64-static -L /usr/aarch64-linux-gnu -cpu max ./a.out
```
For v.so, the regular vtable entry is relocated by an R_AARCH64_ABS64 relocation referencing _ZN1B13do_something2Ev.
```
_ZTV1B:
.xword  _ZN1B13do_something2Ev
```
Using relative vtable entry for a DSO has a downside of creating many PLT entries and making their addresses escape.
The relative vtable entry references a PLT entry _ZN1B13do_something2Ev@plt.
```
.L_ZTV1A.local:
        .word   (_ZN1A13do_something2Ev@PLT-.L_ZTV1A.local)-8
```

fixes: #63580

Reviewed By: peter.smith, MaskRay

Differential Revision: https://reviews.llvm.org/D153264
2023-06-29 22:17:17 +02:00
Alex Brachet
3bd72b2a58 [ELF][NFC] Change comment terminology
Differential Revision: https://reviews.llvm.org/D153978
2023-06-29 11:22:00 +00:00
Fangrui Song
ebbfdca586 [test] Replace aarch64-arm-none-eabi with aarch64
Similar to 02e9441d6ca73314afa1973a234dce1e390da1da, but for llvm/test and one
lld/test/ELF test.
2023-06-27 19:36:27 -07:00
Simon Tatham
cb1d6ea8cf Reland: [ELFAttributeParser] Skip unknown vendor subsections.
An .ARM.attributes section is divided into subsections, each labelled
with a vendor name. There is one standardised vendor name, which must
be used for all attributes that affect compatibility. Subsections
labelled with other vendor names can be used for optimisation
purposes, but it has to be safe for an object file consumer to ignore
them if it doesn't recognise the vendor name.

LLD currently terminates parsing of the whole attributes section as
soon as it encounters a subsection with a vendor name it doesn't
recognise (which is anything other than the standard one). This can
prevent it from detecting compatibility issues, if a standard
subsection followed the vendor-specific one.

This patch modifies the attribute parser so that unrecognised vendor
subsections are silently skipped, and the subsections beyond them are
still processed.

(Relanded with no change from the original commit 8f208edd44d0832. I
reverted it in 949bb7e4de62cd0 due to widespread buildbot breakage,
failing to notice that 975f71faa72aaaa had already fixed the failing
unit test. Also, the *revert* caused at least one buildbot to fail,
because I switched the affected lld test to making %t a directory, and
then the reverted version tried to treat it as a file without cleaning
the output directory first.)

Differential Revision: https://reviews.llvm.org/D153335
2023-06-27 16:39:39 +01:00
Simon Tatham
949bb7e4de Revert "[ELFAttributeParser] Skip unknown vendor subsections."
This reverts commit 8f208edd44d0832ac2580e0ec4238be4ecfd5737.

I completely missed the compiled unit test for ELFAttributeParser,
which also needs updating. I'll reland this change once I make further
fixes.
2023-06-27 14:22:09 +01:00
Simon Tatham
8f208edd44 [ELFAttributeParser] Skip unknown vendor subsections.
An .ARM.attributes section is divided into subsections, each labelled
with a vendor name. There is one standardised vendor name, which must
be used for all attributes that affect compatibility. Subsections
labelled with other vendor names can be used for optimisation
purposes, but it has to be safe for an object file consumer to ignore
them if it doesn't recognise the vendor name.

LLD currently terminates parsing of the whole attributes section as
soon as it encounters a subsection with a vendor name it doesn't
recognise (which is anything other than the standard one). This can
prevent it from detecting compatibility issues, if a standard
subsection followed the vendor-specific one.

This patch modifies the attribute parser so that unrecognised vendor
subsections are silently skipped, and the subsections beyond them are
still processed.

Differential Revision: https://reviews.llvm.org/D153335
2023-06-27 13:22:06 +01:00
Elliot Goodrich
b0abd4893f [llvm] Add missing StringExtras.h includes
In preparation for removing the `#include "llvm/ADT/StringExtras.h"`
from the header to source file of `llvm/Support/Error.h`, first add in
all the missing includes that were previously included transitively
through this header.
2023-06-25 15:42:22 +01:00
John Brawn
5421ab4625 [lld][ARM] Add support for 16-bit thumb group relocations
This adds support for the following relocations:
 * R_ARM_THM_ALU_ABS_G0_NC
 * R_ARM_THM_ALU_ABS_G1_NC
 * R_ARM_THM_ALU_ABS_G2_NC
 * R_ARM_THM_ALU_ABS_G3
as defined in:
https://github.com/ARM-software/abi-aa/blob/main/aaelf32/aaelf32.rst#5615static-thumb16-relocations

Differential Revision: https://reviews.llvm.org/D153407
2023-06-23 13:43:04 +01:00
Simi Pallipurath
f146763e07 Revert "Revert "[lld][Arm] Big Endian - Byte invariant support.""
This reverts commit d8851384c6ac2a1cea15e05228dbde5f13654e23.

Reason: Applied the fix for the Asan buildbot failures.
2023-06-22 16:10:18 +01:00
Mitch Phillips
cd116e0460 Revert "Revert "Revert "[LLD][ELF] Cortex-M Security Extensions (CMSE) Support"""
This reverts commit 9246df7049b0bb83743f860caff4221413c63de2.

Reason: This patch broke the UBSan buildbots. See more information in
the original phabricator review: https://reviews.llvm.org/D139092
2023-06-22 14:33:57 +02:00