Introduce FreeBSD ARM64 support

It's 100% passing test fleet. Solid as a rock.
This commit is contained in:
Justine Tunney 2023-12-29 20:11:23 -08:00
parent 43fe5956ad
commit 83107f78ed
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
455 changed files with 778 additions and 551 deletions

View file

@ -29,12 +29,12 @@
#include "libc/errno.h"
#include "libc/fmt/itoa.h"
#include "libc/fmt/magnumstrs.internal.h"
#include "libc/serialize.h"
#include "libc/limits.h"
#include "libc/log/log.h"
#include "libc/macros.internal.h"
#include "libc/mem/gc.internal.h"
#include "libc/runtime/runtime.h"
#include "libc/serialize.h"
#include "libc/stdckdint.h"
#include "libc/str/str.h"
#include "libc/sysv/consts/map.h"
@ -245,6 +245,10 @@ static void RewriteTlsCode(void) {
}
}
static void UseFreebsdOsAbi(void) {
elf->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
}
/**
* Improve GCC11 `-fpatchable-function-entry` codegen.
*
@ -391,6 +395,9 @@ static void FixupObject(void) {
OptimizePatchableFunctionEntries();
} else if (elf->e_machine == EM_AARCH64) {
RewriteTlsCode();
if (elf->e_type != ET_REL) {
UseFreebsdOsAbi();
}
}
if (elf->e_type != ET_REL) {
RelinkZipFiles();