1081 Commits

Author SHA1 Message Date
Sterling Augustine
1c108c80dc Mark operator== const to avoid errors when asserts are enabled
Without this change, the build will fail like so:

llvm-project/lld/MachO/ObjC.cpp:1387:75: error: ISO C++20 considers use of overloaded operator '==' (with operand types 'ObjcCategoryMerger::PointerListInfo' and 'ObjcCategoryMerger::PointerListInfo') to be ambiguous despite there being a unique best viable function [-Werror,-Wambiguous-reversed-operator]
 1387 |       parseProtocolListInfo(classIsec, roClassLayout.baseProtocolsOffset) ==
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
 1388 |           parseProtocolListInfo(metaIsec, roClassLayout.baseProtocolsOffset) &&
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/assert.h💯27: note: expanded from macro 'assert'
  100 |      (static_cast <bool> (expr)                                         \
      |                           ^~~~
llvm-project/lld/MachO/ObjC.cpp:391:17: note: ambiguity is between a regular call to this operator and a call with the argument order reversed
  391 |     inline bool operator==(const PointerListInfo &cmp) {
      |                 ^
llvm-project/lld/MachO/ObjC.cpp:391:17: note: mark 'operator==' as const or add a matching 'operator!=' to resolve the ambiguity
1 error generated.
2024-05-29 00:28:51 +00:00
alx32
b963931eb8
[lld-macho][ObjC] Implement category merging into base class (#92448)
Currently category merging only supports merging multiple categories
into one. With this commit we add the ability to fully merge categories
into the base class, if the base class is included in the current
module. This is the optimal approach for defined classes.
2024-05-28 10:21:22 -07:00
alx32
5eea4f4425
[lld-macho] Add flag --keep-icf-stabs to LLD for MachO (#93137)
This change adds the `--keep-icf-stabs` which, when specified, preserves
symbols that were folded by ICF in the binary's stabs entries.
This allows `dsymutil` to process debug information for the folded
symbols.
2024-05-27 19:07:39 -07:00
Nikita Popov
1579e9ca9c Revert "Run ObjCContractPass in Default Codegen Pipeline (#92331)"
This reverts commit 8cc8e5d6c6ac9bfc888f3449f7e424678deae8c2.
This reverts commit dae55c89835347a353619f506ee5c8f8a2c136a7.

Causes major compile-time regressions for unoptimized builds.
2024-05-24 08:14:26 +02:00
Nuri Amari
8cc8e5d6c6
Run ObjCContractPass in Default Codegen Pipeline (#92331)
Prior to this patch, when using -fthinlto-index= the ObjCARCContractPass isn't run prior to CodeGen, and instruction selection fails on IR containing arc intrinsics. This patch is motivated by that usecase.

The pass was previously added in various places codegen is performed. This patch adds the pass to the default codegen pipepline, makes sure it bails immediately if no arc intrinsics are found, and removes the adhoc scheduling of the pass. 

Co-authored-by: Nuri Amari <nuriamari@fb.com>
2024-05-23 10:04:55 -07:00
Kazu Hirata
f841ca0c35
Use StringRef::operator== instead of StringRef::equals (NFC) (#91864)
I'm planning to remove StringRef::equals in favor of
StringRef::operator==.

- StringRef::operator==/!= outnumber StringRef::equals by a factor of
  276 under llvm-project/ in terms of their usage.

- The elimination of StringRef::equals brings StringRef closer to
  std::string_view, which has operator== but not equals.

- S == "foo" is more readable than S.equals("foo"), especially for
  !Long.Expression.equals("str") vs Long.Expression != "str".
2024-05-12 23:08:40 -07:00
alx32
db78ee0cb8
[lld-macho] Fix address sanitizer for category merging (#91680)
FIxing the address sanitizer issue reported in
https://github.com/llvm/llvm-project/pull/91548 .
The problem comes from the assignment `auto bodyData = newSectionData`
which defaults to `SmallVector<uint8_t> data = newSectionData` - which
actually creates a copy of the data, placed on the stack.
By explicitly using `ArrayRef` instead, we make sure that the original
copy is used.
We also change the assignment in `ObjcCategoryMerger::newStringData`
from `auto` to `SmallVector<uint8_t> &` to make it explicit.
2024-05-09 17:56:46 -07:00
alx32
c416e43571
[lld-macho] Add support for non-lazy categories to ObjC category merger (#91548)
In ObjC we can have categories that define a `+load` method that is
called when the category is loaded. In such cases, we shouldn't optimize
the category. These categories are present in the `__objc_nlcatlist`
section. So we scan these section for such categories and ignore them
from optimization.
2024-05-09 06:47:37 -07:00
alx32
6e5ed351be
[lld-macho] Fix category merging category map non-determinism (#91159)
Currently in `ObjcCategoryMerger::doMerge` and
`generateCatListForNonErasedCategories` we use maps of pointers which
leads to non-determinism. Switch instead to using `MapVector` which
preserves determinism.
2024-05-06 16:54:41 -07:00
alx32
9fc0b1824b
[lld-macho] Add support for category names in ConcatInputSection's (#90850)
In some cases we see strings from categories being part of "data"
sections (Ex:`__objc_const`), not part of of sections marked as
`cstring_literals`. Since lld treats these sections differently we need
to explicitly implement support for reading strings from the
non-`cstring_literals` sections.

Adding a test that previously would result in an assert.
2024-05-06 09:46:25 -07:00
alx32
5fa24ac277
[lld-macho] Category Merger: add support for addrsig references (#90903)
When generating categories, clang sometimes will generate references in
the `.addrsig` section to the various category data items. Since we may
erase such items after merging them, we also need to remove them from
the `.addrsig` section - otherwise this will cause runtime asserts with
the `.addrsig` section trying to access invalid data.

Implementation wise, we use a hashset to keep track of all erased
`InputSection`'s and then go through all `.addrsig` sections and remove
references to any erased `InputSection`.
2024-05-06 09:45:32 -07:00
alx32
aae3835ecd
[lld-macho] Make category merging symbol names match ld64 (#90864)
When generating symbols for various category constructs, make sure the
symbol names match the format of those generated by ld64 when it does
category merging.
2024-05-02 17:25:13 -07:00
alx32
ff0d09c496
[lld-macho][NFC] Simplify category merging code (#90856)
We modify category merging code to simplify it, as follows:
- We can simplify InfoWriteSection to not be templated - this is not
really necessary.
 - We remove PointerListInfo::categoryOffset as it is not used.
2024-05-02 17:24:44 -07:00
alx32
2a3a79ce4c
[lld-macho][NFC] Preserve original symbol isec, unwindEntry and size (#88357)
Currently, when moving symbols from one `InputSection` to another (like
in ICF) we directly update the symbol's `isec`, `unwindEntry` and
`size`. By doing this we lose the original information. This information
will be needed in a future change. Since when moving symbols we always
set the symbol's `wasCoalesced` and `isec-> replacement`, we can just
use this info to conditionally get the information we need at access
time.
2024-04-18 11:42:22 -07:00
Nico Weber
3eb097339e [lld/mac] Fix (adorable!) typo to cycle bots 2024-04-15 14:33:53 -04:00
David Spickett
aff197ff21 Reland "[flang][clang] Add Visibility specific help text for options (#81869)"
This reverts commit 67d20412b448533c77f54ac7a1e5d0775d273729.

This includes fixes for clanginstallapi.
2024-04-05 08:27:59 +00:00
David Spickett
67d20412b4 Revert "[flang][clang] Add Visibility specific help text for options (#81869)"
This reverts commit 7e958f64efea6cb824e96ace51e021afbc150922.

Failing on multiple bots.
2024-04-05 08:15:35 +00:00
David Spickett
7e958f64ef
[flang][clang] Add Visibility specific help text for options (#81869)
And use it to print the correct default OpenMP version for flang and
flang -fc1.

This change adds an optional `HelpTextsForVariants` to options. This
allows you to change the help text that gets shown in documentation and
`--help` based on the program its being generated for.

As `OptTable` needs to be constexpr compatible, I have used a std::array
of help text variants. Each entry is:
(list of visibilities) - > help text string

So for the OpenMP version we have (flang, fc1) -> "OpenMP version for
flang is...".

So you can have multiple visibilities use the same string. The number of
entries is currently set to 1, and the number of visibilities per entry
is 2, because that's the maximum we need for now. The code is written so
we can increase these numbers later, and the unused elements will be initialised.

I have not applied this to group descriptions just because I don't know
of one that needs changing. It could easily be enabled for those too if
needed. There are minor changes to them just to get it all to compile.

This approach of storing many help strings per option in the 1 driver
library seemed preferable to making a whole new library for Flang (even
if that would mostly be including stuff from Clang).
2024-04-05 09:03:16 +01:00
Keith Smiley
39fe729502
[lld-macho] Ignore -no_warn_duplicate_libraries flag (#86303)
This is a new ld64 flag (along with `-warn_duplicate_libraries`), where
the warning is enabled by default, and it can be useful to ignore since
it can be hard to dedup library flags across large builds. This doesn't
ignore the enabling version since if someone manually passed that and
lld didn't respect it, we probably want the user to know that.
2024-03-28 09:41:08 -07:00
alx32
bbfa50696e
[lld-macho] Fix bug in makeSyntheticInputSection when -dead_strip flag is specified (#86878)
Previously, `makeSyntheticInputSection` would create a new
`ConcatInputSection` without setting `live` explicitly for it. Without
`-dead_strip` this would be OK since `live` would default to `true`.
However, with `-dead_strip`, `live` would default to false, and it would
remain set to `false`.
This hasn't resulted in any issues so far since no code paths that
exposed this issue were present.
However a recent change - ObjC relative method lists
(https://github.com/llvm/llvm-project/pull/86231) exposes this issue by
creating relocations to the `SyntheticInputSection`.
When these relocations are attempted to be written, this ends up with a
crash(assert), since the `SyntheticInputSection` they refer to is marked
as dead (`live` = `false`).

With this change, we set the correct behavior - `live` will always be
`true`. We add a test case that before this change would trigger an
assert in the linker.
2024-03-27 17:27:51 -07:00
alx32
742a82a729
[lld-macho] Implement support for ObjC relative method lists (#86231)
The MachO format supports relative offsets for ObjC method lists. This
support is present already in ld64. With this change we implement this
support in lld also.

Relative method lists can be identified by a specific flag (0x80000000)
in the method list header. When this flag is present, the method list
will contain 32-bit relative offsets to the current Program Counter
(PC), instead of absolute pointers.
Additionally, when relative method lists are used, the offset to the
selector name will now be relative and point to the selector reference
(selref) instead of the name itself.
2024-03-27 14:34:27 -07:00
alx32
e1a003dbbd
[lld-macho][NFC] Refactor ObjCSelRefsSection => ObjCSelRefsHelper (#86456)
In a previous PR: https://github.com/llvm/llvm-project/pull/83878, the
intent was to make no functional changes, just refactor out the code for
reuse.
However, by creating `ObjCSelRefsSection` as a `SyntheticSection` - this
slightly changed the functionality of the application as the
`SyntheticSection` constructor registers the `SyntheticSection` as a
functional one - with an associated `SyntheticInputSection`.

With this change we remove this unintended consequence by making the
code not use a `SyntheticSection` as base, but just by having it be a
static helper.
2024-03-25 06:55:11 -07:00
Amir Ayupov
f66d631bf8 Revert "[BOLT] Add BB index to BAT (#86044)"
This reverts commit 3b3de48fd84b8269d5f45ee0a9dc6b7448368424.
2024-03-22 08:38:40 -07:00
Amir Ayupov
3b3de48fd8
[BOLT] Add BB index to BAT (#86044) 2024-03-22 06:07:17 -07:00
alx32
e4a672ef85
[lld][macho] Fix gcc category merging warning (#86091)
Fixing gcc warning regarding creating non-null-terminated string:
```
../../lld/MachO/ObjC.cpp:1226:10: warning: 'char* strncpy(char*, const char*, size_t)' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
 1226 |   strncpy(strData, str, len);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~
../../lld/MachO/ObjC.cpp: In member function 'void {anonymous}::ObjcCategoryMerger::emitAndLinkPointerList(lld::macho::Defined*, uint32_t, const {anonymous}::ObjcCategoryMerger::ClassExtensionInfo&, const {anonymous}::ObjcCategoryMerger::PointerListInfo&)':
../../lld/MachO/ObjC.cpp:1223:24: note: length computed here
 1223 |   uint32_t len = strlen(str);
      |                  ~~~~~~^~~~~
```
This is not actually a bug, as `newSectionData` returns a
zero-initialized memory region, so the null terminator will be there.
2024-03-21 14:53:09 -07:00
alx32
b609a4d7ea
[lld-macho][NFC] Refactor insertions into inputSections (#85692)
Before this change, after `InputSection` objects are created, they need
to be added to the appropriate container for tracking.
The logic for selecting the appropriate container lives in `Driver.cpp`
/ `gatherInputSections`, where the `InputSection` is added to the
matching container depending on the input config and the type of
`InputSection`.

Also, multiple other locations also insert directly into `inputSections`
array - assuming that that is the appropriate container for the
`InputSection`'s they create. Currently this is the correct assumption,
however an upcoming feature will change this.

For an upcoming feature (relative method lists), we need to route
`InputSection`'s either to `inputSections` array or to a synthetic
section, depending on weather the relative method list optimization is
enabled or not.

We can achieve the above either by duplicating some of the logic or
refactoring the routing and `InputSection`'s and reusing that.

The refactoring & code sharing approach seems the correct way to go - as
such this diff performs the refactoring while not introducing any
functional changes. Later on we can just call `addInputSection` and not
have to worry about routing logic.

---------
2024-03-21 14:50:44 -07:00
Jie Fu
0412840ef8 [lld] Fix -Wstring-conversion in ObjC.cpp (NFC)
llvm-project/lld/MachO/ObjC.cpp:617:12:
error: implicit conversion turns string literal into bool: 'const char[55]' to 'bool' [-Werror,-Wstring-conversion]
  617 |     assert("Tried to read pointer list beyond protocol section end");
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-03-20 10:07:00 +08:00
alx32
cd34860705
[lld-macho] Implement ObjC category merging (-objc_category_merging) (#85727)
This change adds a flag to lld to enable category merging for MachoO +
ObjC.
It adds the '-objc_category_merging' flag for enabling this option and
uses the existing '-no_objc_category_merging' flag for disabling it.
In ld64, this optimization is enabled by default, but in lld, for now,
we require explicitly passing the '-objc_category_merging' flag in order
to enable it.

Behavior: if in the same link unit, multiple categories are extending
the same class, then they get merged into a single category.
Ex: Cat1(method1+method2,protocol1) + Cat2(method3+method4,protocol2,
property1) = Cat1_2(method1+method2+method3+method4,
protocol1+protocol2, property1)

Notes on implementation decisions made in this diff:

There is a possibility to further improve the current implementation by
directly merging the category data into the base class (if the base
class is present in the link unit) - this improvement may be done as a
follow-up. This improved functionality is already present in ld64.
We do the merging on the raw inputSections - after dead-stripping
(categories can't be dead stripped anyway).
The changes are mostly self-contained to ObjC.cpp, except for adding a
new flag (linkerOptimizeReason) to ConcatInputSection and StringPiece to
mark that this data has been optimized away. Another way to do it would
have been to just mark the pieces as not 'live' but this would cause the
old symbols to show up in the linker map as being dead-stripped - even
if dead-stripping is disabled. This flag allows us to match the ld64
behavior.

Note: This is a re-land of
https://github.com/llvm/llvm-project/pull/82928 after fixing using
already freed memory in `generatedSectionData`. This issue was detected
by ASAN build.

---------

Co-authored-by: Alex B <alexborcan@meta.com>
2024-03-19 13:14:29 -07:00
Kyungwoo Lee
5373daad94 Revert "[lld-macho] Implement ObjC category merging (-objc_category_merging) (#82928)"
This reverts commit ece2903ce730392e5236d27f1f387fa8067fcb1b, https://github.com/llvm/llvm-project/pull/82928.

https://github.com/llvm/llvm-project/pull/82928
2024-03-18 17:16:52 -07:00
Kyungwoo Lee
6ae77eca6c Revert "[lld] Fix warnings"
This reverts commit 6800f422c22ffd672b1e31f0d0a3fa29d19b7a13 as the part of revert https://github.com/llvm/llvm-project/pull/82928.

buildbot failures: https://lab.llvm.org/buildbot/#/builders/168/builds/19302/steps/10/logs/stdio
2024-03-18 17:15:40 -07:00
Kazu Hirata
6800f422c2 [lld] Fix warnings
This patch fixes:

  lld/MachO/ObjC.cpp:633:12: error: unused variable 'expectedListSize'
  [-Werror,-Wunused-variable]

  lld/MachO/ObjC.cpp:1034:12: error: unused variable 'newCatDef'
  [-Werror,-Wunused-variable]
2024-03-18 12:01:24 -07:00
alx32
ece2903ce7
[lld-macho] Implement ObjC category merging (-objc_category_merging) (#82928)
This change adds a flag to lld to enable category merging for MachoO +
ObjC.
It adds the '-objc_category_merging' flag for enabling this option and
uses the existing '-no_objc_category_merging' flag for disabling it.
In ld64, this optimization is enabled by default, but in lld, for now,
we require explicitly passing the '-objc_category_merging' flag in order
to enable it.

Behavior: if in the same link unit, multiple categories are extending
the same class, then they get merged into a single category.
Ex: `Cat1(method1+method2,protocol1) + Cat2(method3+method4,protocol2,
property1) = Cat1_2(method1+method2+method3+method4,
protocol1+protocol2, property1)`

Notes on implementation decisions made in this diff:
1. There is a possibility to further improve the current implementation
by directly merging the category data into the base class (if the base
class is present in the link unit) - this improvement may be done as a
follow-up. This improved functionality is already present in ld64.
2. We do the merging on the raw inputSections - after dead-stripping
(categories can't be dead stripped anyway).
3. The changes are mostly self-contained to ObjC.cpp, except for adding
a new flag (linkerOptimizeReason) to ConcatInputSection and StringPiece
to mark that this data has been optimized away. Another way to do it
would have been to just mark the pieces as not 'live' but this would
cause the old symbols to show up in the linker map as being
dead-stripped - even if dead-stripping is disabled. This flag allows us
to match the ld64 behavior.

---------

Co-authored-by: Alex B <alexborcan@meta.com>
2024-03-18 10:08:18 -07:00
alx32
a53401e9df
[lld-macho][NFC] Refactor ObjCSelRefsSection out of ObjCStubsSection (#83878)
Currently ObjCStubsSection is handling both the logic for the
"__objc_stubs" section, as well as the logic for the "__objc_selrefs"
section.
While this is OK for now, it will be an issue for other features that
want to interact with the "__objc_selrefs" section, such as upcoming
relative method lists feature - which will also want to create /
reference entries in the "__objc_selrefs" section.
In this PR we split the logic relating to handling the "__objc_selrefs"
section into a new SyntheticSection (ObjCSelRefsSection). Non-functional
change - neither the behavior nor implementation changes, the interface
is just made more friendly to not have "__objc_selrefs" so bound to
"__objc_stubs".

---------

Co-authored-by: Alex B <alexborcan@meta.com>
2024-03-10 13:22:31 -07:00
Mehdi Amini
716042a63f
Rename llvm::ThreadPool -> llvm::DefaultThreadPool (NFC) (#83702)
The base class llvm::ThreadPoolInterface will be renamed
llvm::ThreadPool in a subsequent commit.

This is a breaking change: clients who use to create a ThreadPool must
now create a DefaultThreadPool instead.
2024-03-05 18:00:46 -08:00
alx32
7a2d9347d3
[lld][macho][NFC] Add specific namespace scope for objc symbol names (#83618)
Move symbol names from directly under `objc` scope to
`objc::symbol_names`.
Ex: `objc::klass` -> `objc::symbol_names::klass`

Co-authored-by: Alex B <alexborcan@meta.com>
2024-03-01 14:12:56 -08:00
rohit-rao
b0bae44517
[lld] Adds support for xros. (#83031) 2024-02-27 15:29:34 -05:00
Hans Wennborg
f55b79f59a Revert "[lld] enable fixup chains by default (#79894)"
This caused links to fail with:

  lld/MachO/Symbols.cpp:97:
  virtual uint64_t lld::macho::Defined::getVA() const:
  Assertion `target->usesThunks()' failed.

or crash when asserts are disabled. See comment on
https://github.com/llvm/llvm-project/pull/79894

> Enable chained fixups in lld when all platform and version criteria are
> met. This is an attempt at simplifying the logic used in ld 907:
>
> 93d74eafc3/src/ld/Options.cpp (L5458-L5549)
>
> Some changes were made to simplify the logic:
> - only enable chained fixups for macOS from 13.0 to avoid the arch check
> - only enable chained fixups for iphonesimulator from 16.0 to avoid the
> arch check
> - don't enable chained fixups for not specifically listed platforms
> - don't enable chained fixups for arm64_32

This reverts commit 775c2856fb32868f357a3ce3f2b4139541e12578.
2024-02-16 14:45:33 +01:00
Nico Weber
624ea349d7
[lld/MachO] Fix assert on unsorted data-in-code entries (#81758)
When the data-in-code entries are in separate sections, they are not
guaranteed to be sorted. In particular, 68b1cc36f3df marked some libc++
string functions as noinline, which leads to global ctors involving
strings now producing data-in-code sections in __TEXT,__StaticInit,
which is why this now happens in practice.

Since data-in-code entries are relatively rare and small, just sort
them. No observed performance impact.

See also crbug.com/41487860
2024-02-16 07:46:58 -05:00
Kyungwoo Lee
391393179a
[lld-macho] icf objc stubs (#79730)
This supports icf for objc stubs.
2024-02-01 14:19:11 -08:00
alx32
f0c8d88e25
[lld-macho] Make ObjC category checker print the source file name of category (#80221)
When printing category conflicts in the ObjC category checker, also
print the source file name of the problematic categories. Currently we
only print the object file name. This change is mostly useful only for
thinLTO builds, where the object file name will be of form
999.arm64.lto.o and thus does not reveal any information about the
original source file.

---------

Co-authored-by: Alex Borcan <alexborcan@meta.com>
2024-02-01 10:31:27 -08:00
Richard Howell
775c2856fb
[lld] enable fixup chains by default (#79894)
Enable chained fixups in lld when all platform and version criteria are
met. This is an attempt at simplifying the logic used in ld 907:

93d74eafc3/src/ld/Options.cpp (L5458-L5549)

Some changes were made to simplify the logic:
- only enable chained fixups for macOS from 13.0 to avoid the arch check
- only enable chained fixups for iphonesimulator from 16.0 to avoid the
arch check
- don't enable chained fixups for not specifically listed platforms
- don't enable chained fixups for arm64_32
2024-01-31 10:30:03 -08:00
Kyungwoo Lee
cb46c61817
[lld-macho] dead-strip objc stubs (#79726)
This supports dead-strip for objc stubs.
2024-01-29 23:29:57 -08:00
Cyndy Ishida
d9a9872ec4
[TextAPI] Rename SymbolKind to EncodeKind (#79622)
A distinction that doesn't _usually_ matter is that the
MachO::SymbolKind is really a mapping of entries in TBD files not
symbols. To better understand this, rename the enum so it represents an
encoding mapped to TBDs as opposed to symbols alone.

For example, it can be a bit confusing that "GlobalSymbol" is a enum
value when all of those values can represent a GlobalSymbol.
2024-01-26 16:12:50 -08:00
Kyungwoo Lee
77e204c7b0
[lld-macho][arm64] implement -objc_stubs_small (#78665)
This patch implements `-objc_stubs_small` targeting arm64, aiming to
align with ld64's behavior.
1. `-objc_stubs_fast`: As previously implemented, this always uses the
Global Offset Table (GOT) to invoke `objc_msgSend`. The alignment of the
objc stub is 32 bytes.
2. `-objc_stubs_small`: This behavior depends on whether `objc_msgSend`
is defined. If it is, it directly jumps to `objc_msgSend`. If not, it
creates another stub to indirectly jump to `objc_msgSend`, minimizing
the size. The alignment of the objc stub in this case is 4 bytes.
2024-01-23 07:31:34 -08:00
Kazu Hirata
21730eb49b [lld] Use SmallString::operator std::string (NFC) 2024-01-22 00:13:23 -08:00
OldWorldOrdr
46a9135d61
[lld-macho] Find objects in library search path (#78628)
Find object files in library search path just like Apple's linker, this
makes building with some older MacOS SDKs easier since clang runs with
`-lcrt1.10.6.o`
2024-01-20 13:53:55 -08:00
kyulee-com
5de1d007dd
[lld-macho] Fix for objc_msgSend stubs (#78557)
This commit corrects the address computation for objc_msgSend stubs.
Previously, the address computation was incidentally correct due to
objc_msgSend often being the first entry in the got section, resulting
in a 0 index. This commit ensures accurate address computation
regardless of the objc_msgSend stub's position in the got section.
2024-01-18 10:46:30 -08:00
Kazu Hirata
51fb76ff1d [lld] Use StringRef::consume_front_insensitive (NFC) 2024-01-12 22:08:26 -08:00
Nico Weber
d782f198a6 lld/MachO: Fix two typos to cycle bots 2023-12-22 12:06:38 -05:00
Kazu Hirata
cc4ecfd68b
[ADT] Rename SmallString::{starts,ends}with to {starts,ends}_with (#74916)
This patch renames {starts,ends}with to {starts,ends}_with for
consistency with std::{string,string_view}::{starts,ends}_with in
C++20.  Since there are only a handful of occurrences, this patch
skips the deprecation phase and simply renames them.
2023-12-09 14:28:45 -08:00