llvm-capstone/lld/test/MachO
Jez Ng daaaed6bb8 [lld-macho] Fix TLV data initialization
We were mishandling the case where both `__tbss` and `__thread_data` sections were
present.

TLVP relocations should be encoded as offsets from the start of `__thread_data`,
even if the symbol is actually located in `__thread_bss`. Previously, we were
writing the offset from the start of the containing section, which doesn't
really make sense since there's no way `tlv_get_addr()` can know which section a
given `tlv$init` symbol is in at runtime.

In addition, this patch ensures that we place `__thread_data` immediately before
`__thread_bss`. This is what ld64 does, likely for performance reasons. Zerofill
sections must also be at the end of their segments; we were already doing this,
but now we ensure that `__thread_bss` occurs before `__bss`, so that it's always
possible to have it contiguous with `__thread_data`.

Fixes llvm.org/PR48657.

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D94329
2021-01-08 18:48:12 -05:00
..
Inputs [lld-macho][nfc] Clean up tests 2020-12-21 14:44:08 -05:00
invalid [lld-macho][nfc] Clean up tests 2020-12-21 14:44:08 -05:00
tools Handle overflow beyond the 127 common encodings limit 2020-12-19 14:54:37 -08: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][nfc] Clean up tests 2020-12-21 14:44:08 -05:00
bitcode-nodatalayout.ll [lld-macho] Support parsing of bitcode within archives 2020-12-08 10:34:32 -08:00
bss.s [lld-macho] Fix TLV data initialization 2021-01-08 18:48:12 -05: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][nfc] Clean up tests 2020-12-21 14:44:08 -05: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 [lld-macho] Implement option: -undefined TREATMENT 2020-12-17 17:40:50 -08:00
driver.test [lld][test] Relax test assertion of cmake defaults appearing in --version output. 2020-12-23 14:33:04 -08: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/mac] Implement support for private extern symbols 2020-12-21 21:23:33 -05: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][nfc] Clean up tests 2020-12-21 14:44:08 -05:00
force-load.s [lld-macho][nfc] Clean up tests 2020-12-21 14:44:08 -05:00
framework.s [lld-macho][nfc] Clean up tests 2020-12-21 14:44:08 -05:00
headerpad.s [lld-macho][nfc] Remove %T from headerpad.s 2020-12-21 14:44:08 -05: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][nfc] Clean up tests 2020-12-21 14:44:08 -05: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][nfc] Clean up tests 2020-12-21 14:44:08 -05:00
order-file.s [lld-macho][nfc] Clean up tests 2020-12-21 14:44:08 -05:00
platform-version.s [lld-macho] Simulator & DriverKit executables should always be PIE 2020-12-23 11:24:12 -05:00
private-extern.s [lld/mac] Implement support for private extern symbols 2020-12-21 21:23:33 -05: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][nfc] Clean up tests 2020-12-21 14:44:08 -05: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][nfc] Clean up tests 2020-12-21 14:44:08 -05: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][nfc] Clean up tests 2020-12-21 14:44:08 -05: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][nfc] Clean up tests 2020-12-21 14:44:08 -05:00
subsections-symbol-relocs.s [lld-macho][nfc] Clean up tests 2020-12-21 14:44:08 -05:00
symbol-order.s [lld-macho][nfc] Clean up tests 2020-12-21 14:44:08 -05:00
symtab.s glld/mac] Don't add names of unreferenced symbols to string table 2020-12-22 15:52:33 -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] Fix TLV data initialization 2021-01-08 18:48:12 -05:00
treat-undef-sym.s [lld-macho] Implement option: -undefined TREATMENT 2020-12-17 17:40:50 -08: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][nfc] Clean up tests 2020-12-21 14:44:08 -05:00
weak-definition-indirect-fetch.s [lld-macho][nfc] Clean up tests 2020-12-21 14:44:08 -05:00
weak-definition-order.s [lld-macho][nfc] Clean up tests 2020-12-21 14:44:08 -05:00
weak-definition-over-dysym.s [lld-macho][nfc] Clean up tests 2020-12-21 14:44:08 -05: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] Use LC_LOAD_WEAK_DYLIB for dylibs with only weakrefs 2020-12-17 08:49:17 -05:00
weak-private-extern.s [lld/mac] Implement support for private extern symbols 2020-12-21 21:23:33 -05:00
weak-reference.s [lld-macho] Implement option: -undefined TREATMENT 2020-12-17 17:40:50 -08: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 [lld-macho] Simulator & DriverKit executables should always be PIE 2020-12-23 11:24:12 -05:00