llvm-project/lld/test/MachO
Jez Ng 811444d7a1 [lld-macho] Add support for weak references
Weak references need not necessarily be satisfied at runtime (but they must
still be satisfied at link time). So symbol resolution still works as per usual,
but we now pass around a flag -- ultimately emitting it in the bind table -- to
indicate if a given dylib symbol is a weak reference.

ld64's behavior for symbols that have both weak and strong references is
a bit bizarre. For non-function symbols, it will emit a weak import. For
function symbols (those referenced by BRANCH relocs), it will emit a
regular import. I'm not sure what value there is in that behavior, and
since emulating it will make our implementation more complex, I've
decided to treat regular weakrefs like function symbol ones for now.

Fixes PR48511.

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D93369
2020-12-17 08:49:16 -05:00
..
Inputs [lld-macho] Disable invalid/stub-link.s test for Mac 2020-08-27 11:24:22 -07:00
invalid [lld-macho] -weak_{library,framework} should always take priority 2020-12-15 15:58:26 -05:00
tools lld/mach-o: Make tool scripts from 2124ca1d5c py2.7-compatible 2020-09-19 09:17:02 -04:00
abs-symbols.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
arch.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
archive.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
bitcode-nodatalayout.ll [lld-macho] Support parsing of bitcode within archives 2020-12-08 10:34:32 -08:00
bss.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
codemodel.ll [lld-macho] Add support for -mcpu, -mattr, -code-model in LTO 2020-12-10 15:57:51 -08:00
color-diagnostics.test [lld/mac] Implement basic typo correction for flags 2020-11-24 11:33:39 -05:00
common-symbol-coalescing.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
common-symbol-resolution.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
compact-unwind-pie.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
compact-unwind.test [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
cpu-string.ll [lld-macho] Add support for -mcpu, -mattr, -code-model in LTO 2020-12-10 15:57:51 -08:00
demangle.s clang+lld: Improve clang+ld.darwinnew.lld interaction, pass -demangle 2020-11-24 08:51:58 -05:00
driver.test [lld/mac] Implement basic typo correction for flags 2020-11-24 11:33:39 -05:00
dso-handle.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
dylib-stub.yaml [lld] Use temporary directory to create test outputs 2020-11-12 14:24:05 +01:00
dylib-version.s [mac/lld] simplify code using PackedVersion instead of VersionTuple 2020-12-15 19:23:07 -05:00
dylib.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
dylink-lazy.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
dylink.s [lld/mac] fill in current and compatibility version for LC_LOAD_(WEAK_)DYLIB 2020-12-15 19:34:59 -05:00
entry-symbol.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
export-trie.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
fat-arch.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
fatal-warnings.s [mac/lld] Run tests with -fatal_warnings by default 2020-12-03 21:23:47 -05:00
filelist.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
force-load.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
framework.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
headerpad.s [lld-macho] Implement LC_UUID 2020-11-10 12:19:28 -08:00
implicit-dylibs.s [lld-macho] Add implicit dylib support for frameworks 2020-12-15 15:58:26 -05:00
indirect-symtab.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
lc-build-version.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
lc-linker-option.ll [lld-macho] Don't load dylibs more than once 2020-12-10 15:57:52 -08:00
link-search-order.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
linkedit-contiguity.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
lit.local.cfg [mac/lld] Run tests with -fatal_warnings by default 2020-12-03 21:23:47 -05:00
load-commands.s [mac/lld] Run tests with -fatal_warnings by default 2020-12-03 21:23:47 -05:00
local-got.s [lld-macho] Implement LC_UUID 2020-11-10 12:19:28 -08:00
lto-archive.ll [lld-macho] Support parsing of bitcode within archives 2020-12-08 10:34:32 -08:00
lto-object-path.ll [lld-macho] Disable some tests that are failing on Windows 2020-12-10 17:54:23 -08:00
lto-save-temps.ll [lld-macho] Add very basic support for LTO 2020-11-10 12:19:28 -08:00
mattrs.ll [lld-macho] Don't include absolute address value in expected test output 2020-12-10 17:54:23 -08:00
module-asm.ll [lld-macho] Initialize AsmParsers earlier 2020-12-10 15:57:52 -08:00
no-exports-dylib.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
no-unneeded-dyld-info.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
nonweak-definition-override.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
objc.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
order-file.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
platform-version.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
reexport-stub.s [lld-macho] Implement `-no_implicit_dylibs` 2020-12-10 15:57:52 -08:00
relocations.s [lld-macho] Implement LC_UUID 2020-11-10 12:19:28 -08:00
reproduce-thin-archives.s [mac/lld] Make --reproduce work with thin archives 2020-12-02 09:48:31 -05:00
reproduce.s [lld/mac] Add --reproduce option 2020-11-30 08:40:21 -05:00
resolution.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
responsefile.test [mac/lld] Add support for response files 2020-11-30 08:23:58 -05:00
rpath.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
search-paths-darwin.test [lld-macho] Add missing search-paths-darwin.test 2020-06-17 20:51:26 -07:00
search-paths.test [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
sectcreate.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
section-headers.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
section-merge.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
segments.s [lld-macho][easy] Fix segment max protection 2020-11-10 12:19:28 -08:00
silent-ignore.test [lld/mac] Implement basic typo correction for flags 2020-11-24 11:33:39 -05:00
stabs.s [lld-macho] Don't attempt to emit rebase opcodes for debug sections 2020-12-10 15:57:51 -08:00
static-link.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
stub-framework.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
stub-link.s [mac/lld] fix amend mishap from ec88746a05 2020-12-15 19:41:00 -05:00
sub-library.s [lld-macho] Support -sub_umbrella 2020-12-15 15:58:26 -05:00
subsections-section-relocs.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
subsections-symbol-relocs.s [lld-macho] Emit local symbols in symtab; record metadata in LC_DYSYMTAB 2020-12-01 15:05:20 -08:00
symbol-order.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
symtab.s [lld-macho] Add support for weak references 2020-12-17 08:49:16 -05:00
syslibroot.test [lld-macho] Don't warn on non-existent system libraries 2020-11-30 16:07:20 -05:00
t.s try more to fix t.s on Windows after 7cb0a373d1 2020-12-03 18:06:34 -05:00
thin-archive.s [mac/lld] fix typo in 07ab597bb0 that broke test on Windows 2020-12-01 20:36:49 -05:00
tlv-dylib.s [lld-macho] Don't emit rebase opcodes for relocs in TLV sections 2020-12-15 15:58:26 -05:00
tlv.s [lld-macho] Don't emit rebase opcodes for relocs in TLV sections 2020-12-15 15:58:26 -05:00
weak-binding.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
weak-definition-direct-fetch.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
weak-definition-indirect-fetch.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
weak-definition-order.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
weak-definition-over-dysym.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
weak-header-flags.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
weak-import.s [lld-macho] -weak_{library,framework} should always take priority 2020-12-15 15:58:26 -05:00
weak-reference.s [lld-macho] Add support for weak references 2020-12-17 08:49:16 -05:00
why-load.s Reland "[mac/lld] Implement -why_load". 2020-12-03 08:35:12 -05:00
x86-64-reloc-got-load.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
x86-64-reloc-signed.s [lld-macho] Always include custom syslibroot when running tests 2020-09-25 11:28:36 -07:00
x86-64-reloc-unsigned.s [mac/lld] Run tests with -fatal_warnings by default 2020-12-03 21:23:47 -05:00