rust/compiler/rustc_target
Dylan DPC a7f9aca0a6
Rollup merge of #82534 - nikic:musl-crtend, r=nagisa
Link crtbegin/crtend on musl to terminate .eh_frame

For some targets, rustc uses a "CRT fallback", where it links CRT
object files it ships instead of letting the host compiler link
them.

On musl, rustc currently links crt1, crti and crtn (provided by
libc), but does not link crtbegin and crtend (provided by libgcc).
In particular, crtend is responsible for terminating the .eh_frame
section. Lack of terminator may result in segfaults during
unwinding, as reported in #47551 and encountered by the LLVM 12
update in #81451.

This patch links crtbegin and crtend for musl as well, following
the table at the top of crt_objects.rs.

r? ``@nagisa``
2021-02-27 21:56:19 +01:00
..
src Rollup merge of #82534 - nikic:musl-crtend, r=nagisa 2021-02-27 21:56:19 +01:00
Cargo.toml
README.md

librustc_target contains some very low-level details that are specific to different compilation targets and so forth.

For more information about how rustc works, see the rustc dev guide.