mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-22 01:43:22 +00:00
[no-plt] enable no-plt behavior on linux arm64 and amd64 targets
This commit is contained in:
@@ -602,6 +602,7 @@ struct BuildContext {
|
||||
RelocMode reloc_mode;
|
||||
bool disable_red_zone;
|
||||
bool disable_unwind;
|
||||
bool no_plt;
|
||||
|
||||
isize max_error_count;
|
||||
|
||||
@@ -1902,6 +1903,12 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta
|
||||
if (bc->reloc_mode == RelocMode_Default) {
|
||||
bc->reloc_mode = RelocMode_PIC;
|
||||
}
|
||||
switch (metrics->arch) {
|
||||
case TargetArch_arm64:
|
||||
case TargetArch_amd64:
|
||||
bc->no_plt = true;
|
||||
break;
|
||||
}
|
||||
} else if (metrics->os == TargetOs_openbsd) {
|
||||
// Always use PIC for OpenBSD: it defaults to PIE
|
||||
if (bc->reloc_mode == RelocMode_Default) {
|
||||
|
||||
Reference in New Issue
Block a user