llvm-project/lld/test
Nico Weber 86c8f395ae [lld/mac] Leave more room for thunks in thunk placement code
Fixes PR51578 in practice.

Currently there's only enough room for a single thunk, which for real-life code
isn't enough. The error case only happens when there are many branch statements
very close to each other (0 or 1 instructions apart), with the function at the
finalization barrier small.

There's a FIXME on what to do if we hit this case, but that suggestion sounds
complicated to me (see end of PR51578 comment 5 for why).

Instead, just leave more room for thunks. Chromium's unit_tests links fine with
room for 3 thunks. Leave room for 100, which should fix this for most cases in
practice.

There's little cost for leaving lots of room: This slop value only determines
when we finalize sections, and we insert thunks for forward jumps into
unfinalized sections. So leaving room means we'll need a few more thunks, but
the thunk jump range is 128 MiB while a single thunk is just 12 bytes.

For Chromium's unit_tests:
With a slop of   3: thunk calls = 355418, thunks = 10903
With a slop of 100: thunk calls = 355426, thunks = 10904

Chances are 100 is enough for all use cases we'll hit in practice, but even
bumping it to 1000 would probably be fine.

Differential Revision: https://reviews.llvm.org/D108930
2021-08-30 22:09:05 -04:00
..
COFF [lld/COFF] Improve handling of the /manifestdependency: flag 2021-08-25 14:36:32 -04:00
ELF [lld/test/ELF] Test fetch from archive to resolve undefined symbols in shared libs 2021-08-27 14:17:32 -07:00
MachO [lld/mac] Leave more room for thunks in thunk placement code 2021-08-30 22:09:05 -04:00
MinGW [LLD] [MinGW] Add more options for disabling flags in the executable 2021-08-12 13:27:09 +03:00
Unit Support multi-configuration generators correctly in several config files 2021-02-11 09:32:20 -08:00
darwin [lld-macho] Switch default to new Darwin backend 2021-03-01 12:30:10 -05:00
mach-o [test] Avoid llvm-nm one-dash long options 2021-07-15 09:50:36 -07:00
wasm [WebAssembly] Tidy up EH/SjLj options 2021-08-24 17:54:39 -07:00
CMakeLists.txt [lld] Add llvm-profdata to lld test deps 2021-08-11 11:52:40 -07:00
lit.cfg.py [lld-macho] Initial groundwork for -bitcode_bundle 2021-04-16 16:47:14 -04:00
lit.site.cfg.py.in Fix lld macho standalone build by including llvm/Config/llvm-config.h instead of llvm/Config/config.h 2021-05-19 11:15:07 -04:00