mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-06 08:56:22 +00:00
Get --ftrace working on aarch64
This change implements a new approach to function call logging, that's based on the GCC flag: -fpatchable-function-entry. Read the commentary in build/config.mk to learn how it works.
This commit is contained in:
parent
5b908bc756
commit
eb40cb371d
934 changed files with 2259 additions and 1268 deletions
|
@ -71,6 +71,8 @@ SECTIONS {
|
|||
KEEP(*(SORT_NONE(.fini)))
|
||||
} =0x1f2003d5
|
||||
|
||||
. = ALIGN(__privileged_end > __privileged_start ? 0x4000 : 1);
|
||||
|
||||
.privileged : {
|
||||
PROVIDE_HIDDEN(__privileged_start = .);
|
||||
*(.privileged*)
|
||||
|
@ -271,6 +273,10 @@ SECTIONS {
|
|||
}
|
||||
}
|
||||
|
||||
HIDDEN(__privileged_addr = ROUNDDOWN(__privileged_start, PAGESIZE));
|
||||
HIDDEN(__privileged_size = (ROUNDUP(__privileged_end, PAGESIZE) -
|
||||
ROUNDDOWN(__privileged_start, PAGESIZE)));
|
||||
|
||||
PROVIDE(ape_stack_memsz = DEFINED(ape_stack_memsz) ? ape_stack_memsz : STACKSIZE);
|
||||
PROVIDE_HIDDEN(_tls_size = _tbss_end - _tdata_start);
|
||||
PROVIDE_HIDDEN(_tdata_size = _tdata_end - _tdata_start);
|
||||
|
|
|
@ -89,7 +89,7 @@ APE_SRCS = $(APE_SRCS_C) $(APE_SRCS_S)
|
|||
APE_OBJS = $(APE_SRCS_S:%.S=o/$(MODE)/%.o)
|
||||
APE_CHECKS = $(APE_HDRS:%=o/%.ok)
|
||||
|
||||
o/$(MODE)/ape/public/ape.lds: OVERRIDE_CPPFLAGS += -UCOSMO
|
||||
o/$(MODE)/ape/public/ape.lds: CPPFLAGS += -UCOSMO
|
||||
o/$(MODE)/ape/public/ape.lds: \
|
||||
ape/public/ape.lds \
|
||||
ape/ape.lds \
|
||||
|
|
Binary file not shown.
|
@ -12,13 +12,15 @@
|
|||
# - Reasonably small
|
||||
#
|
||||
ifeq ($(MODE),)
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) $(FTRACE) -O2
|
||||
ENABLE_FTRACE = 1
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) -O2
|
||||
CONFIG_CPPFLAGS += -DSYSDEBUG
|
||||
TARGET_ARCH ?= -msse3
|
||||
endif
|
||||
|
||||
ifeq ($(MODE), aarch64)
|
||||
CONFIG_CCFLAGS += -O2 $(BACKTRACES) #$(FTRACE)
|
||||
ENABLE_FTRACE = 1
|
||||
CONFIG_CCFLAGS += -O2 $(BACKTRACES)
|
||||
CONFIG_CPPFLAGS += -DSYSDEBUG
|
||||
endif
|
||||
|
||||
|
@ -33,7 +35,8 @@ endif
|
|||
# - Compiles 28% faster
|
||||
#
|
||||
ifeq ($(MODE), fastbuild)
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) $(FTRACE) -O
|
||||
ENABLE_FTRACE = 1
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) -O
|
||||
CONFIG_CPPFLAGS += -DSYSDEBUG -DDWARFLESS
|
||||
CONFIG_OFLAGS += -g0
|
||||
CONFIG_LDFLAGS += -S
|
||||
|
@ -53,8 +56,9 @@ endif
|
|||
# - GCC 8+ hoists check fails into .text.cold, thus minimizing impact
|
||||
#
|
||||
ifeq ($(MODE), opt)
|
||||
ENABLE_FTRACE = 1
|
||||
CONFIG_CPPFLAGS += -DNDEBUG -DSYSDEBUG -msse2avx -Wa,-msse2avx
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) $(FTRACE) -O3 -fmerge-all-constants
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) -O3 -fmerge-all-constants
|
||||
TARGET_ARCH ?= -march=native
|
||||
endif
|
||||
|
||||
|
@ -123,16 +127,18 @@ endif
|
|||
# - Enormous binaries
|
||||
#
|
||||
ifeq ($(MODE), dbg)
|
||||
ENABLE_FTRACE = 1
|
||||
CONFIG_CPPFLAGS += -DMODE_DBG
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) $(FTRACE) -DSYSDEBUG -O -fno-inline
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) -DSYSDEBUG -O -fno-inline
|
||||
CONFIG_COPTS += -fsanitize=address -fsanitize=undefined
|
||||
TARGET_ARCH ?= -msse3
|
||||
OVERRIDE_CCFLAGS += -fno-pie
|
||||
endif
|
||||
|
||||
ifeq ($(MODE), aarch64-dbg)
|
||||
ENABLE_FTRACE = 1
|
||||
CONFIG_CPPFLAGS += -DMODE_DBG
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) $(FTRACE) -DSYSDEBUG -O -fno-inline
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) -DSYSDEBUG -O -fno-inline
|
||||
CONFIG_COPTS += -fsanitize=undefined
|
||||
endif
|
||||
|
||||
|
@ -147,7 +153,8 @@ endif
|
|||
# - No Windows bloat!
|
||||
#
|
||||
ifeq ($(MODE), sysv)
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) $(FTRACE) -O2
|
||||
ENABLE_FTRACE = 1
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) -O2
|
||||
CONFIG_CPPFLAGS += -DSYSDEBUG -DSUPPORT_VECTOR=121
|
||||
TARGET_ARCH ?= -msse3
|
||||
endif
|
||||
|
@ -363,8 +370,9 @@ endif
|
|||
# GCC11 Mode
|
||||
# https://justine.lol/compilers/x86_64-linux-musl__x86_64-linux-musl__g++-11.2.0.tar.xz
|
||||
ifeq ($(MODE), gcc11)
|
||||
ENABLE_FTRACE = 1
|
||||
.UNVEIL += rx:/opt/gcc11
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) $(FTRACE) -DSYSDEBUG -O2
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) -DSYSDEBUG -O2
|
||||
AS = /opt/gcc11/bin/x86_64-linux-musl-as
|
||||
CC = /opt/gcc11/bin/x86_64-linux-musl-gcc
|
||||
CXX = /opt/gcc11/bin/x86_64-linux-musl-g++
|
||||
|
@ -376,7 +384,7 @@ STRIP = /opt/gcc11/bin/x86_64-linux-musl-strip
|
|||
OBJCOPY = /opt/gcc11/bin/x86_64-linux-musl-objcopy
|
||||
OBJDUMP = /opt/gcc11/bin/x86_64-linux-musl-objdump
|
||||
ADDR2LINE = /opt/gcc11/bin/x86_64-linux-musl-addr2line
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) $(FTRACE) -O2 -Wno-stringop-overread
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) -O2 -Wno-stringop-overread
|
||||
CONFIG_CFLAGS += -Wno-old-style-definition
|
||||
CONFIG_CPPFLAGS += -DNDEBUG -DSYSDEBUG
|
||||
TARGET_ARCH ?= -msse3
|
||||
|
@ -385,7 +393,7 @@ endif
|
|||
# LLVM Mode
|
||||
ifeq ($(MODE), llvm)
|
||||
TARGET_ARCH ?= -msse3
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) $(FTRACE) -DSYSDEBUG -O2
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) -DSYSDEBUG -O2
|
||||
AS = clang
|
||||
CC = clang
|
||||
CXX = clang++
|
||||
|
@ -432,3 +440,59 @@ CONFIG_CXXFLAGS += -std=c++11
|
|||
TARGET_ARCH ?= -msse3
|
||||
|
||||
endif
|
||||
|
||||
ifneq ($(ENABLE_FTRACE),)
|
||||
CONFIG_CPPFLAGS += -DFTRACE
|
||||
FTRACE_CCFLAGS = -fno-inline-functions-called-once
|
||||
OVERRIDE_CFLAGS += $(FTRACE_CCFLAGS)
|
||||
OVERRIDE_CXXFLAGS += $(FTRACE_CCFLAGS)
|
||||
# function prologue nops for --ftrace
|
||||
ifeq ($(ARCH), x86_64)
|
||||
# this flag causes gcc to generate functions like this
|
||||
#
|
||||
# nop nop nop nop nop nop nop nop nop
|
||||
# func:
|
||||
# nop nop
|
||||
# ...
|
||||
#
|
||||
# which tool/build/fixupobj.c improves at build time like this
|
||||
#
|
||||
# nop nop nop nop nop nop nop nop nop
|
||||
# func:
|
||||
# xchg %ax,%ax
|
||||
# ...
|
||||
#
|
||||
# which --ftrace morphs at runtime like this
|
||||
#
|
||||
# ud2 # 2 bytes
|
||||
# call ftrace_hook # 5 bytes
|
||||
# jmp +2 # 2 bytes
|
||||
# func:
|
||||
# jmp -7 # 2 bytes
|
||||
# ...
|
||||
#
|
||||
CONFIG_CCFLAGS += -fpatchable-function-entry=11,9
|
||||
endif
|
||||
ifeq ($(ARCH), aarch64)
|
||||
# this flag causes gcc to generate functions like this
|
||||
#
|
||||
# nop nop nop nop nop nop
|
||||
# func:
|
||||
# nop
|
||||
# ...
|
||||
#
|
||||
# which --ftrace morphs at runtime like this
|
||||
#
|
||||
# brk #31337
|
||||
# stp x29,x30,[sp,#-16]!
|
||||
# mov x29,sp
|
||||
# bl ftrace_hook
|
||||
# ldp x29,x30,[sp],#16
|
||||
# b +1
|
||||
# func:
|
||||
# b -5
|
||||
# ...
|
||||
#
|
||||
CONFIG_CCFLAGS += -fpatchable-function-entry=7,6
|
||||
endif
|
||||
endif
|
||||
|
|
|
@ -137,9 +137,6 @@ else
|
|||
IMAGE_BASE_VIRTUAL ?= 0x400000
|
||||
endif
|
||||
|
||||
FTRACE = \
|
||||
-pg
|
||||
|
||||
BACKTRACES = \
|
||||
-fno-omit-frame-pointer \
|
||||
-fno-optimize-sibling-calls \
|
||||
|
|
|
@ -41,11 +41,11 @@ $(DSP_BMP_A).pkg: \
|
|||
|
||||
o/$(MODE)/dsp/bmp/float2short.o \
|
||||
o/$(MODE)/dsp/bmp/scalevolume.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
$(MATHEMATICAL)
|
||||
|
||||
o/tiny/dsp/bmp/scalevolume.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-Os
|
||||
|
||||
DSP_BMP_LIBS = $(foreach x,$(DSP_BMP_ARTIFACTS),$($(x)))
|
||||
|
|
|
@ -40,15 +40,15 @@ o/$(MODE)/dsp/core/magikarp.o \
|
|||
o/$(MODE)/dsp/core/c93654369.o \
|
||||
o/$(MODE)/dsp/core/float2short.o \
|
||||
o/$(MODE)/dsp/core/scalevolume.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
$(MATHEMATICAL)
|
||||
|
||||
o/tiny/dsp/core/scalevolume.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-Os
|
||||
|
||||
o/$(MODE)/dsp/core/det3.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-ffast-math
|
||||
|
||||
DSP_CORE_LIBS = $(foreach x,$(DSP_CORE_ARTIFACTS),$($(x)))
|
||||
|
|
|
@ -52,7 +52,7 @@ $(DSP_MPEG_A).pkg: \
|
|||
$(foreach x,$(DSP_MPEG_A_DIRECTDEPS),$($(x)_A).pkg)
|
||||
|
||||
o/$(MODE)/dsp/mpeg/clamp4int256-k8.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-Os
|
||||
|
||||
DSP_MPEG_LIBS = $(foreach x,$(DSP_MPEG_ARTIFACTS),$($(x)))
|
||||
|
|
|
@ -52,7 +52,7 @@ o/$(MODE)/dsp/scale/cdecimate2xuint8x8.o \
|
|||
o/$(MODE)/dsp/scale/gyarados.o \
|
||||
o/$(MODE)/dsp/scale/magikarp.o \
|
||||
o/$(MODE)/dsp/scale/scale.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
$(MATHEMATICAL)
|
||||
|
||||
DSP_SCALE_LIBS = $(foreach x,$(DSP_SCALE_ARTIFACTS),$($(x)))
|
||||
|
|
|
@ -54,12 +54,12 @@ $(DSP_TTY_A).pkg: \
|
|||
$(foreach x,$(DSP_TTY_A_DIRECTDEPS),$($(x)_A).pkg)
|
||||
|
||||
o/$(MODE)/dsp/tty/ttyraster.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
$(MATHEMATICAL)
|
||||
|
||||
ifeq ($(ARCH), aarch64)
|
||||
# takes 14 seconds to compile with aarch64 gcc
|
||||
o/$(MODE)/dsp/tty/ttyraster.o: private OVERRIDE_CFLAGS += -O1
|
||||
o/$(MODE)/dsp/tty/ttyraster.o: private CFLAGS += -O1
|
||||
o/$(MODE)/dsp/tty/ttyraster.o: private QUOTA += -C128
|
||||
endif
|
||||
|
||||
|
|
|
@ -23,10 +23,11 @@
|
|||
// @param rdi points to nonempty array
|
||||
// @param rsi is item count divisible by 16
|
||||
// @note needs avx2 (haswell+)
|
||||
.ftrace1
|
||||
windex_avx2:
|
||||
.ftrace2
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
and $-32,%rsp
|
||||
sub $32,%rsp
|
||||
vmovdqa (%rdi),%ymm1
|
||||
|
|
|
@ -23,10 +23,11 @@
|
|||
// @param rdi points to nonempty array
|
||||
// @param esi is 16-byte aligned 8+ / 8 multiple array item count
|
||||
// @note needs sse4 (nehalem+)
|
||||
.ftrace1
|
||||
windex_sse4:
|
||||
.ftrace2
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov $8,%eax
|
||||
sub $32,%rsp
|
||||
movdqa (%rdi),%xmm2
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────*/
|
||||
#endif
|
||||
#include "libc/calls/struct/timespec.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/time/time.h"
|
||||
|
||||
|
@ -16,6 +17,7 @@
|
|||
*/
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
ShowCrashReports();
|
||||
unsigned long i;
|
||||
volatile unsigned long x;
|
||||
struct timespec now, start, next, interval;
|
||||
|
|
|
@ -103,7 +103,7 @@ o/$(MODE)/examples/examples.pkg: \
|
|||
$(foreach x,$(EXAMPLES_DIRECTDEPS),$($(x)_A).pkg)
|
||||
|
||||
o/$(MODE)/examples/unbourne.o: private \
|
||||
OVERRIDE_CPPFLAGS += \
|
||||
CPPFLAGS += \
|
||||
-DSTACK_FRAME_UNLIMITED \
|
||||
-fpie
|
||||
|
||||
|
@ -169,7 +169,7 @@ o/$(MODE)/examples/symtab.com: \
|
|||
@$(MAKE_SYMTAB_ZIP)
|
||||
|
||||
o/$(MODE)/examples/picol.o: private \
|
||||
OVERRIDE_CPPFLAGS += \
|
||||
CPPFLAGS += \
|
||||
-DSTACK_FRAME_UNLIMITED
|
||||
|
||||
o/$(MODE)/examples/picol.com.dbg: \
|
||||
|
|
|
@ -69,21 +69,21 @@ $(LIBC_CALLS_A).pkg: \
|
|||
# we can't use asan because:
|
||||
# siginfo_t memory is owned by kernels
|
||||
o/$(MODE)/libc/calls/siginfo2cosmo.o: private \
|
||||
OVERRIDE_COPTS += \
|
||||
COPTS += \
|
||||
-ffreestanding \
|
||||
-fno-sanitize=address
|
||||
|
||||
# we can't use asan because:
|
||||
# ucontext_t memory is owned by xnu kernel
|
||||
o/$(MODE)/libc/calls/sigenter-xnu.o: private \
|
||||
OVERRIDE_COPTS += \
|
||||
COPTS += \
|
||||
-ffreestanding \
|
||||
-fno-sanitize=address
|
||||
|
||||
# we can't use asan because:
|
||||
# vdso memory is owned by linux kernel
|
||||
o/$(MODE)/libc/calls/vdsofunc.greg.o: private \
|
||||
OVERRIDE_COPTS += \
|
||||
COPTS += \
|
||||
-ffreestanding \
|
||||
-fno-sanitize=address
|
||||
|
||||
|
@ -92,7 +92,7 @@ o/$(MODE)/libc/calls/vdsofunc.greg.o: private \
|
|||
o/$(MODE)/libc/calls/ntspawn.o \
|
||||
o/$(MODE)/libc/calls/mkntcmdline.o \
|
||||
o/$(MODE)/libc/calls/mkntenvblock.o: private \
|
||||
OVERRIDE_COPTS += \
|
||||
COPTS += \
|
||||
-ffreestanding \
|
||||
-fno-sanitize=address
|
||||
|
||||
|
@ -100,7 +100,7 @@ o/$(MODE)/libc/calls/mkntenvblock.o: private \
|
|||
# windows owns the data structure
|
||||
o/$(MODE)/libc/calls/wincrash.o \
|
||||
o/$(MODE)/libc/calls/ntcontext2linux.o: private \
|
||||
OVERRIDE_COPTS += \
|
||||
COPTS += \
|
||||
-fno-sanitize=all
|
||||
|
||||
# we always want -O3 because:
|
||||
|
@ -111,7 +111,7 @@ o/$(MODE)/libc/calls/sigenter-netbsd.o \
|
|||
o/$(MODE)/libc/calls/sigenter-openbsd.o \
|
||||
o/$(MODE)/libc/calls/sigenter-xnu.o \
|
||||
o/$(MODE)/libc/calls/ntcontext2linux.o: private \
|
||||
OVERRIDE_COPTS += \
|
||||
COPTS += \
|
||||
-O3
|
||||
|
||||
# we must disable static stack safety because:
|
||||
|
@ -125,14 +125,14 @@ o/$(MODE)/libc/calls/execve-sysv.o \
|
|||
o/$(MODE)/libc/calls/readlinkat-nt.o \
|
||||
o/$(MODE)/libc/calls/execve-nt.greg.o \
|
||||
o/$(MODE)/libc/calls/mkntenvblock.o: private \
|
||||
OVERRIDE_CPPFLAGS += \
|
||||
CPPFLAGS += \
|
||||
-DSTACK_FRAME_UNLIMITED
|
||||
|
||||
# we must segregate codegen because:
|
||||
# file contains multiple independently linkable apis
|
||||
o/$(MODE)/libc/calls/ioctl-siocgifconf.o \
|
||||
o/$(MODE)/libc/calls/ioctl-siocgifconf-nt.o: private \
|
||||
OVERRIDE_COPTS += \
|
||||
COPTS += \
|
||||
-ffunction-sections \
|
||||
-fdata-sections
|
||||
|
||||
|
@ -156,7 +156,7 @@ o//libc/calls/ioctl_tiocgwinsz.o \
|
|||
o//libc/calls/ioctl_tiocswinsz-nt.o \
|
||||
o//libc/calls/ioctl_tiocswinsz.o \
|
||||
o//libc/calls/fcntl.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-Os
|
||||
|
||||
# we always want -Os because:
|
||||
|
@ -165,7 +165,7 @@ o//libc/calls/getcwd.greg.o \
|
|||
o//libc/calls/getcwd-nt.greg.o \
|
||||
o//libc/calls/getcwd-xnu.greg.o \
|
||||
o//libc/calls/statfs2cosmo.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-Os
|
||||
|
||||
# we always want -O2 because:
|
||||
|
@ -180,17 +180,17 @@ o/$(MODE)/libc/calls/timespec_frommicros.o \
|
|||
o/$(MODE)/libc/calls/timeval_tomillis.o \
|
||||
o/$(MODE)/libc/calls/timeval_frommillis.o \
|
||||
o/$(MODE)/libc/calls/timeval_frommicros.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-O2
|
||||
|
||||
o/$(MODE)/libc/calls/pledge-linux.o \
|
||||
o/$(MODE)/libc/calls/unveil.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-DSTACK_FRAME_UNLIMITED
|
||||
|
||||
ifeq ($(ARCH), aarch64)
|
||||
o/$(MODE)/libc/calls/sigaction.o: private OVERRIDE_CFLAGS += -mcmodel=large
|
||||
o/$(MODE)/libc/calls/getloadavg-nt.o: private OVERRIDE_CFLAGS += -ffreestanding
|
||||
o/$(MODE)/libc/calls/sigaction.o: private CFLAGS += -mcmodel=large
|
||||
o/$(MODE)/libc/calls/getloadavg-nt.o: private CFLAGS += -ffreestanding
|
||||
endif
|
||||
|
||||
# we want -Os because:
|
||||
|
@ -198,7 +198,7 @@ endif
|
|||
# we need pic because:
|
||||
# so it can be an LD_PRELOAD payload
|
||||
o/$(MODE)/libc/calls/pledge-linux.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-Os \
|
||||
-fPIC
|
||||
|
||||
|
|
|
@ -26,9 +26,10 @@
|
|||
// @return remainder ∈ (-|𝑦|,|𝑦|) in %st
|
||||
// @define 𝑥-truncl(𝑥/𝑦)*𝑦
|
||||
// @see emod()
|
||||
fmodl: push %rbp
|
||||
.ftrace1
|
||||
fmodl: .ftrace2
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
fldt 32(%rbp)
|
||||
fldt 16(%rbp)
|
||||
1: fprem
|
||||
|
|
|
@ -12,7 +12,9 @@ typedef struct Elf64_Sym {
|
|||
uint8_t st_other;
|
||||
/* SHN_UNDEF, <section index>, SHN_ABS, SHN_COMMON, etc. */
|
||||
Elf64_Section st_shndx;
|
||||
/* byte offset into GetElfSectionAddress(st_shndx) */
|
||||
Elf64_Addr st_value;
|
||||
/* byte length optionally set by .size directive */
|
||||
Elf64_Xword st_size;
|
||||
} Elf64_Sym;
|
||||
|
||||
|
|
|
@ -55,14 +55,14 @@ $(LIBC_FMT_A).pkg: \
|
|||
$(foreach x,$(LIBC_FMT_A_DIRECTDEPS),$($(x)_A).pkg)
|
||||
|
||||
$(LIBC_FMT_A_OBJS): private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-fno-jump-tables
|
||||
|
||||
o/$(MODE)/libc/fmt/formatint64.o \
|
||||
o/$(MODE)/libc/fmt/formatint64thousands.o \
|
||||
o/$(MODE)/libc/fmt/dosdatetimetounix.o \
|
||||
o/$(MODE)/libc/fmt/itoa64radix10.greg.o: private\
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-O3
|
||||
|
||||
o/$(MODE)/libc/fmt/atoi.o \
|
||||
|
@ -74,7 +74,7 @@ o/$(MODE)/libc/fmt/strtoimax.o \
|
|||
o/$(MODE)/libc/fmt/strtoumax.o \
|
||||
o/$(MODE)/libc/fmt/wcstoimax.o \
|
||||
o/$(MODE)/libc/fmt/wcstoumax.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-Os
|
||||
|
||||
# we can't use compiler magic because:
|
||||
|
@ -82,7 +82,7 @@ o/$(MODE)/libc/fmt/wcstoumax.o: private \
|
|||
o/$(MODE)/libc/fmt/strerrno.greg.o \
|
||||
o/$(MODE)/libc/fmt/strerrdoc.greg.o \
|
||||
o/$(MODE)/libc/fmt/strerror_wr.greg.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-fpie \
|
||||
-ffreestanding \
|
||||
$(NO_MAGIC)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_INTRIN_AARCH64_ASMDEFS_H_
|
||||
#define COSMOPOLITAN_LIBC_INTRIN_AARCH64_ASMDEFS_H_
|
||||
#include "libc/macros.internal.h"
|
||||
#ifdef __ASSEMBLER__
|
||||
// clang-format off
|
||||
|
||||
|
@ -44,7 +45,9 @@ GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_PAC)
|
|||
.global name; \
|
||||
.type name,%function; \
|
||||
.align alignment; \
|
||||
.ftrace1; \
|
||||
name: \
|
||||
.ftrace2; \
|
||||
.cfi_startproc; \
|
||||
BTI_C;
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
│ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │
|
||||
│ │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/aarch64/asmdefs.h"
|
||||
#include "libc/intrin/aarch64/asmdefs.internal.h"
|
||||
|
||||
#define __memchr_aarch64 memchr
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
│ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │
|
||||
│ │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/aarch64/asmdefs.h"
|
||||
#include "libc/intrin/aarch64/asmdefs.internal.h"
|
||||
|
||||
#define __memcmp_aarch64 memcmp
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
│ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │
|
||||
│ │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/aarch64/asmdefs.h"
|
||||
#include "libc/intrin/aarch64/asmdefs.internal.h"
|
||||
|
||||
#define __memcpy_aarch64_simd memcpy
|
||||
#define __memmove_aarch64_simd memmove
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
│ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │
|
||||
│ │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/aarch64/asmdefs.h"
|
||||
#include "libc/intrin/aarch64/asmdefs.internal.h"
|
||||
|
||||
#define __memrchr_aarch64 memrchr
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
│ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │
|
||||
│ │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/aarch64/asmdefs.h"
|
||||
#include "libc/intrin/aarch64/asmdefs.internal.h"
|
||||
|
||||
#define __memset_aarch64 memset
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
│ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │
|
||||
│ │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/aarch64/asmdefs.h"
|
||||
#include "libc/intrin/aarch64/asmdefs.internal.h"
|
||||
|
||||
#define __stpcpy_aarch64 stpcpy
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
│ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │
|
||||
│ │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/aarch64/asmdefs.h"
|
||||
#include "libc/intrin/aarch64/asmdefs.internal.h"
|
||||
|
||||
#define __strchr_aarch64 strchr
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
│ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │
|
||||
│ │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/aarch64/asmdefs.h"
|
||||
#include "libc/intrin/aarch64/asmdefs.internal.h"
|
||||
|
||||
#define __strchrnul_aarch64 strchrnul
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
│ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │
|
||||
│ │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/aarch64/asmdefs.h"
|
||||
#include "libc/intrin/aarch64/asmdefs.internal.h"
|
||||
|
||||
#define __strcmp_aarch64 strcmp
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
│ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │
|
||||
│ │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/aarch64/asmdefs.h"
|
||||
#include "libc/intrin/aarch64/asmdefs.internal.h"
|
||||
|
||||
#define __strcpy_aarch64 strcpy
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
│ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │
|
||||
│ │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/aarch64/asmdefs.h"
|
||||
#include "libc/intrin/aarch64/asmdefs.internal.h"
|
||||
|
||||
#define __strlen_aarch64 strlen
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
│ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │
|
||||
│ │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/aarch64/asmdefs.h"
|
||||
#include "libc/intrin/aarch64/asmdefs.internal.h"
|
||||
|
||||
#define __strncmp_aarch64 strncmp
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
│ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │
|
||||
│ │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/aarch64/asmdefs.h"
|
||||
#include "libc/intrin/aarch64/asmdefs.internal.h"
|
||||
|
||||
#define __strnlen_aarch64 strnlen
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
│ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │
|
||||
│ │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/aarch64/asmdefs.h"
|
||||
#include "libc/intrin/aarch64/asmdefs.internal.h"
|
||||
|
||||
#define __strrchr_aarch64 strrchr
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "libc/intrin/weaken.h"
|
||||
#include "libc/log/backtrace.internal.h"
|
||||
#include "libc/log/internal.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/runtime/symbols.internal.h"
|
||||
#include "libc/thread/thread.h"
|
||||
|
@ -38,7 +39,7 @@ relegated void __assert_fail(const char *expr, const char *file, int line) {
|
|||
strace_enabled(-1);
|
||||
ftrace_enabled(-1);
|
||||
owner = 0;
|
||||
me = __tls_enabled ? __get_tls()->tib_tid : sys_gettid();
|
||||
me = __tls_enabled ? __get_tls()->tib_tid : __pid;
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, 0);
|
||||
kprintf("%s:%d: assert(%s) failed (tid %d) %m\n", file, line, expr, me);
|
||||
if (__vforked ||
|
||||
|
|
|
@ -33,9 +33,10 @@
|
|||
// @param rsi:rdi is 128-bit unsigned 𝑥 value
|
||||
// @return eax number in range [0,128) or undef if 𝑥 is 0
|
||||
// @see also treasure trove of nearly identical functions
|
||||
.ftrace1
|
||||
_bsr128:
|
||||
.ftrace2
|
||||
.leafprologue
|
||||
.profilable
|
||||
bsr %rsi,%rax
|
||||
jnz 2f
|
||||
bsr %rdi,%rax
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
typedef char xmm_t __attribute__((__vector_size__(16), __aligned__(1)));
|
||||
typedef long long xmm_a __attribute__((__vector_size__(16), __aligned__(16)));
|
||||
|
||||
static void bzero_sse(char *p, size_t n) {
|
||||
static void bzero128(char *p, size_t n) {
|
||||
xmm_t v = {0};
|
||||
if (IsAsan()) __asan_verify(p, n);
|
||||
if (n <= 32) {
|
||||
|
@ -162,6 +162,6 @@ void bzero(void *p, size_t n) {
|
|||
bzero_avx(b, n);
|
||||
#endif
|
||||
} else {
|
||||
bzero_sse(b, n);
|
||||
bzero128(b, n);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ LIBC_INTRIN_A_CHECKS = $(LIBC_INTRIN_A).pkg
|
|||
|
||||
ifeq ($(ARCH), aarch64)
|
||||
LIBC_INTRIN_A_SRCS_S += $(wildcard libc/intrin/aarch64/*.S)
|
||||
LIBC_INTRIN_A_HDRS += libc/intrin/aarch64/asmdefs.internal.h
|
||||
endif
|
||||
|
||||
LIBC_INTRIN_A_OBJS = \
|
||||
|
@ -49,39 +50,39 @@ $(LIBC_INTRIN_A).pkg: \
|
|||
# we can't use asan because:
|
||||
# __strace_init() calls this before asan is initialized
|
||||
o/$(MODE)/libc/intrin/strace_enabled.o: private \
|
||||
OVERRIDE_COPTS += \
|
||||
COPTS += \
|
||||
-fno-sanitize=address
|
||||
|
||||
# we can't use asan because:
|
||||
# asan guard pages haven't been allocated yet
|
||||
o/$(MODE)/libc/intrin/directmap.o \
|
||||
o/$(MODE)/libc/intrin/directmap-nt.o: private \
|
||||
OVERRIDE_COPTS += \
|
||||
COPTS += \
|
||||
-ffreestanding \
|
||||
-fno-sanitize=address
|
||||
|
||||
# we want small code size because:
|
||||
# to keep .text.head under 4096 bytes
|
||||
o/$(MODE)/libc/intrin/mman.greg.o: private \
|
||||
OVERRIDE_COPTS += \
|
||||
COPTS += \
|
||||
-Os
|
||||
|
||||
# we can't use asan and ubsan because:
|
||||
# this is asan and ubsan
|
||||
o/$(MODE)/libc/intrin/asan.o \
|
||||
o/$(MODE)/libc/intrin/ubsan.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-fno-sanitize=all \
|
||||
-fno-stack-protector
|
||||
|
||||
o/$(MODE)/libc/intrin/asan.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-O2 \
|
||||
-finline \
|
||||
-finline-functions
|
||||
|
||||
o/$(MODE)/libc/intrin/asanthunk.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-x-no-pg \
|
||||
$(MNO_FENTRY) \
|
||||
-ffreestanding \
|
||||
|
@ -95,7 +96,7 @@ o/$(MODE)/libc/intrin/strerrno.greg.o \
|
|||
o/$(MODE)/libc/intrin/strerrdoc.greg.o \
|
||||
o/$(MODE)/libc/intrin/strerror_wr.greg.o \
|
||||
o/$(MODE)/libc/intrin/kprintf.greg.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-fpie \
|
||||
-fwrapv \
|
||||
-x-no-pg \
|
||||
|
@ -109,10 +110,9 @@ o/$(MODE)/libc/intrin/kprintf.greg.o: private \
|
|||
o/$(MODE)/libc/intrin/futex_wait.o \
|
||||
o/$(MODE)/libc/intrin/futex_wake.o \
|
||||
o/$(MODE)/libc/intrin/gettid.greg.o \
|
||||
o/$(MODE)/libc/intrin/sys_gettid.greg.o \
|
||||
o/$(MODE)/libc/intrin/_trylock_debug_4.o \
|
||||
o/$(MODE)/libc/intrin/_spinlock_debug_4.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-fwrapv \
|
||||
-x-no-pg \
|
||||
$(MNO_FENTRY) \
|
||||
|
@ -125,13 +125,13 @@ o/$(MODE)/libc/intrin/_spinlock_debug_4.o: private \
|
|||
# global gone could be raised
|
||||
o/$(MODE)/libc/intrin/exit.o \
|
||||
o/$(MODE)/libc/intrin/restorewintty.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-fno-sanitize=all
|
||||
|
||||
# we can't use -ftrapv because:
|
||||
# this file implements it
|
||||
o/$(MODE)/libc/intrin/ftrapv.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-ffunction-sections \
|
||||
-ffreestanding \
|
||||
-fwrapv
|
||||
|
@ -142,7 +142,7 @@ o/$(MODE)/libc/intrin/describeflags.o \
|
|||
o/$(MODE)/libc/intrin/describeframe.o \
|
||||
o/$(MODE)/libc/intrin/describemapflags.o \
|
||||
o/$(MODE)/libc/intrin/describeprotflags.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-fno-sanitize=address
|
||||
|
||||
o/$(MODE)/libc/intrin/exit1.greg.o \
|
||||
|
@ -180,7 +180,7 @@ o/$(MODE)/libc/intrin/createfilemappingnuma.o \
|
|||
o/$(MODE)/libc/intrin/waitformultipleobjects.o \
|
||||
o/$(MODE)/libc/intrin/generateconsolectrlevent.o \
|
||||
o/$(MODE)/libc/intrin/wsawaitformultipleevents.o: private\
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-Os \
|
||||
-fwrapv \
|
||||
-ffreestanding \
|
||||
|
@ -188,20 +188,20 @@ o/$(MODE)/libc/intrin/wsawaitformultipleevents.o: private\
|
|||
-fno-sanitize=all
|
||||
|
||||
o//libc/intrin/memmove.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-fno-toplevel-reorder
|
||||
|
||||
o//libc/intrin/bzero.o \
|
||||
o//libc/intrin/memcmp.o \
|
||||
o//libc/intrin/memset.o \
|
||||
o//libc/intrin/memmove.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-O2 -finline
|
||||
|
||||
o/$(MODE)/libc/intrin/bzero.o \
|
||||
o/$(MODE)/libc/intrin/memcmp.o \
|
||||
o/$(MODE)/libc/intrin/memmove.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-fpie
|
||||
|
||||
# these assembly files are safe to build on aarch64
|
||||
|
|
|
@ -382,7 +382,7 @@ privileged static size_t kformat(char *b, size_t n, const char *fmt,
|
|||
if (tib) {
|
||||
x = atomic_load_explicit(&tib->tib_tid, memory_order_relaxed);
|
||||
} else {
|
||||
x = sys_gettid();
|
||||
x = __pid;
|
||||
}
|
||||
if (!__nocolor && p + 7 <= e) {
|
||||
*p++ = '\e';
|
||||
|
|
|
@ -19,13 +19,14 @@
|
|||
#include "libc/dce.h"
|
||||
#include "libc/sysv/consts/nr.h"
|
||||
#include "libc/macros.internal.h"
|
||||
.privileged
|
||||
|
||||
// Relinquishes scheduled quantum.
|
||||
//
|
||||
// @return 0 on success, or -1 w/ errno
|
||||
// @norestart
|
||||
.ftrace1
|
||||
sched_yield:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "libc/dce.h"
|
||||
#include "libc/intrin/asan.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#ifndef __aarch64__
|
||||
|
||||
/**
|
||||
* Compares NUL-terminated strings.
|
||||
|
@ -28,7 +29,7 @@
|
|||
* @return is <0, 0, or >0 based on uint8_t comparison
|
||||
* @asyncsignalsafe
|
||||
*/
|
||||
noasan int strcmp(const char *a, const char *b) {
|
||||
int strcmp(const char *a, const char *b) {
|
||||
int c;
|
||||
size_t i = 0;
|
||||
uint64_t v, w, d;
|
||||
|
@ -58,3 +59,5 @@ noasan int strcmp(const char *a, const char *b) {
|
|||
}
|
||||
return (a[i] & 255) - (b[i] & 255);
|
||||
}
|
||||
|
||||
#endif /* __aarch64__ */
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
__msabi extern typeof(GetCurrentThreadId) *const __imp_GetCurrentThreadId;
|
||||
|
||||
privileged int sys_gettid(void) {
|
||||
int sys_gettid(void) {
|
||||
#ifdef __x86_64__
|
||||
int tid;
|
||||
int64_t wut;
|
||||
|
|
|
@ -23,8 +23,9 @@
|
|||
// @param edi is int to encode
|
||||
// @return rax is word-encoded byte buffer
|
||||
// @note invented on a napkin in a new jersey diner
|
||||
_tpenc: .leafprologue
|
||||
.profilable
|
||||
.ftrace1
|
||||
_tpenc: .ftrace2
|
||||
.leafprologue
|
||||
mov %edi,%edi
|
||||
xor %eax,%eax
|
||||
cmp $127,%edi
|
||||
|
@ -47,20 +48,20 @@ _tpenc: .leafprologue
|
|||
.rodata
|
||||
.balign 4
|
||||
.underrun
|
||||
kTpenc: .rept 4 # MSB≤10 (0x7FF)
|
||||
.byte 1,0b11000000 # len,mark
|
||||
kTpenc: .rept 4 // MSB≤10 (0x7FF)
|
||||
.byte 1,0b11000000 // len,mark
|
||||
.endr
|
||||
.rept 5 # MSB≤15 (0xFFFF)
|
||||
.byte 2,0b11100000 # len,mark
|
||||
.rept 5 // MSB≤15 (0xFFFF)
|
||||
.byte 2,0b11100000 // len,mark
|
||||
.endr
|
||||
.rept 5 # MSB≤20 (0x1FFFFF)
|
||||
.byte 3,0b11110000 # len,mark
|
||||
.rept 5 // MSB≤20 (0x1FFFFF)
|
||||
.byte 3,0b11110000 // len,mark
|
||||
.endr
|
||||
.rept 5 # MSB≤25 (0x3FFFFFF)
|
||||
.byte 4,0b11111000 # len,mark
|
||||
.rept 5 // MSB≤25 (0x3FFFFFF)
|
||||
.byte 4,0b11111000 // len,mark
|
||||
.endr
|
||||
.rept 6 # MSB≤31 (0xffffffff)
|
||||
.byte 5,0b11111100 # len,mark
|
||||
.rept 6 // MSB≤31 (0xffffffff)
|
||||
.byte 5,0b11111100 // len,mark
|
||||
.endr
|
||||
.zero 2
|
||||
.endobj kTpenc
|
||||
|
|
|
@ -58,15 +58,15 @@ $(LIBC_LOG_A).pkg: \
|
|||
|
||||
o/$(MODE)/libc/log/backtrace2.o \
|
||||
o/$(MODE)/libc/log/backtrace3.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-fno-sanitize=all
|
||||
|
||||
o/$(MODE)/libc/log/checkfail.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-mgeneral-regs-only
|
||||
|
||||
o/$(MODE)/libc/log/watch.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
-ffreestanding
|
||||
|
||||
o/$(MODE)/libc/log/watch.o \
|
||||
|
@ -82,7 +82,7 @@ o/$(MODE)/libc/log/startfatal.o \
|
|||
o/$(MODE)/libc/log/startfatal_ndebug.o \
|
||||
o/$(MODE)/libc/log/ubsan.o \
|
||||
o/$(MODE)/libc/log/die.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
$(NO_MAGIC)
|
||||
|
||||
LIBC_LOG_LIBS = $(foreach x,$(LIBC_LOG_ARTIFACTS),$($(x)))
|
||||
|
|
|
@ -213,6 +213,36 @@
|
|||
.org 1347b+\fieldsize,0x00
|
||||
.endm
|
||||
|
||||
// Inserts --ftrace pre-prologue.
|
||||
// This goes immediately before the function symbol.
|
||||
// @see .ftrace2
|
||||
.macro .ftrace1
|
||||
#ifdef FTRACE
|
||||
#ifdef __x86_64__
|
||||
.rept 9
|
||||
nop
|
||||
.endr
|
||||
#elif defined(__aarch64__)
|
||||
.rept 6
|
||||
nop
|
||||
.endr
|
||||
#endif /* __x86_64__ */
|
||||
#endif /* FTRACE */
|
||||
.endm
|
||||
|
||||
// Inserts --ftrace prologue.
|
||||
// This goes immediately after the function symbol.
|
||||
// @see .ftrace1
|
||||
.macro .ftrace2
|
||||
#ifdef FTRACE
|
||||
#ifdef __x86_64__
|
||||
xchg %ax,%ax
|
||||
#elif defined(__aarch64__)
|
||||
nop
|
||||
#endif /* __x86_64__ */
|
||||
#endif /* FTRACE */
|
||||
.endm
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
||||
#if __MNO_VZEROUPPER__ + 0
|
||||
|
@ -346,7 +376,7 @@
|
|||
|
||||
// Pads function prologue unconditionally for runtime hooking.
|
||||
// @cost ≥0.3 cycles, 5 bytes
|
||||
// @see .profilable
|
||||
// @see .ftrace1
|
||||
.macro .hookable
|
||||
.byte 0x0f
|
||||
.byte 0x1f
|
||||
|
@ -473,31 +503,6 @@
|
|||
#endif
|
||||
.endm
|
||||
|
||||
// Inserts profiling hook in prologue if cc wants it.
|
||||
//
|
||||
// Cosmopolitan does this in a slightly different way from normal
|
||||
// GNU toolchains. We always use the -mnop-mcount behavior, since
|
||||
// the runtime is able to morph the binary at runtime. It is good
|
||||
// since we can put hooks for profiling and function tracing into
|
||||
// most builds, without any impact on performance.
|
||||
//
|
||||
// @cost ≥0.3 cycles, 5 bytes
|
||||
// @see build/compile
|
||||
.macro .profilable
|
||||
#ifdef __PG__
|
||||
1382:
|
||||
#if defined(__MFENTRY__)
|
||||
call __fentry__
|
||||
#elif defined(__PIC__) || defined(__PIE__)
|
||||
// nopw 0x00(%rax,%rax,1)
|
||||
.byte 0x66,0x0f,0x1f,0x44,0x00,0x00
|
||||
#else
|
||||
// nopl 0x00(%rax,%rax,1)
|
||||
.byte 0x0f,0x1f,0x44,0x00,0x00
|
||||
#endif
|
||||
#endif
|
||||
.endm
|
||||
|
||||
// Pushes RVA on stack of linktime mergeable string literal.
|
||||
// @see popstr
|
||||
.macro pushstr text
|
||||
|
|
|
@ -30,11 +30,12 @@
|
|||
// @see examples/ctrlc.c
|
||||
// @threadsafe
|
||||
// @noreturn
|
||||
.ftrace1
|
||||
_gclongjmp:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov %fs:0,%r12 # __get_tls()
|
||||
mov 0x18(%r12),%r12 # Tls::garbages
|
||||
test %r12,%r12
|
||||
|
|
|
@ -25,7 +25,9 @@
|
|||
// @noreturn
|
||||
// @see _gclongjmp()
|
||||
// @see siglongjmp()
|
||||
.ftrace1
|
||||
longjmp:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
mov %esi,%eax
|
||||
test %eax,%eax
|
||||
|
|
|
@ -32,10 +32,11 @@
|
|||
// @param rdx is right hand side which must have 4 quadwords
|
||||
// @note words are host endian while array is little endian
|
||||
// @mayalias
|
||||
.ftrace1
|
||||
Mul4x4Adx:
|
||||
.ftrace2
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
sub $56,%rsp
|
||||
mov %r15,-8(%rbp)
|
||||
mov %r14,-16(%rbp)
|
||||
|
|
|
@ -32,10 +32,11 @@
|
|||
// @param rdx is right hand side which must have 4 quadwords
|
||||
// @note words are host endian while array is little endian
|
||||
// @mayalias
|
||||
.ftrace1
|
||||
Mul6x6Adx:
|
||||
.ftrace2
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
sub $64,%rsp
|
||||
mov %r15,-8(%rbp)
|
||||
mov %r14,-16(%rbp)
|
||||
|
|
|
@ -32,10 +32,11 @@
|
|||
// @param rdx is right hand side which must have 8 quadwords
|
||||
// @note words are host endian while array is little endian
|
||||
// @mayalias
|
||||
.ftrace1
|
||||
Mul8x8Adx:
|
||||
.ftrace2
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
sub $104,%rsp
|
||||
mov %r15,-8(%rbp)
|
||||
mov %r14,-16(%rbp)
|
||||
|
|
|
@ -56,7 +56,7 @@ o/$(MODE)/libc/nexgen32e/ktoupper.o \
|
|||
o/$(MODE)/libc/nexgen32e/pid.o \
|
||||
o/$(MODE)/libc/nexgen32e/program_invocation_name2.o \
|
||||
o/$(MODE)/libc/nexgen32e/threaded.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
CFLAGS += \
|
||||
$(NO_MAGIC)
|
||||
|
||||
# these assembly files are safe to build on aarch64
|
||||
|
|
|
@ -29,12 +29,13 @@
|
|||
// @return %rax,%xmm0
|
||||
// @note slower than __sysv2nt
|
||||
// @see NT2SYSV() macro
|
||||
.ftrace1
|
||||
__nt2sysv:
|
||||
.ftrace2
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
// TODO(jart): We should probably find some way to use our own
|
||||
// stack when Windows delivers signals ;_;
|
||||
.profilable
|
||||
sub $0x100,%rsp
|
||||
push %rbx
|
||||
push %rdi
|
||||
|
|
|
@ -24,9 +24,10 @@
|
|||
// @param di points to output buffer
|
||||
// @param si points to uint8_t {len₁,byte₁}, ..., {0,0}
|
||||
// @mode long,legacy,real
|
||||
.ftrace1
|
||||
rldecode:
|
||||
.ftrace2
|
||||
.leafprologue
|
||||
.profilable
|
||||
xor %ecx,%ecx
|
||||
0: lodsb
|
||||
xchg %al,%cl
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
// @assume system five nexgen32e abi conformant
|
||||
// @note code built w/ microsoft abi compiler can't call this
|
||||
// @see longjmp(), _gclongjmp()
|
||||
setjmp:
|
||||
.ftrace1
|
||||
setjmp: .ftrace2
|
||||
#ifdef __x86_64__
|
||||
lea 8(%rsp),%rax
|
||||
mov %rax,(%rdi)
|
||||
|
|
|
@ -613,10 +613,11 @@ BSWAP_SHUFB_CTL:
|
|||
// @param %rsi points to input data
|
||||
// @param %rdx is number of 64-byte blocks to process
|
||||
// @see X86_HAVE(SHA)
|
||||
.ftrace1
|
||||
sha1_transform_avx2:
|
||||
.ftrace2
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
push %rbx
|
||||
push %r12
|
||||
push %r13
|
||||
|
|
|
@ -77,10 +77,11 @@ Tim Chen <tim.c.chen@linux.intel.com>\n"
|
|||
// @param %rsi points to input data
|
||||
// @param %rdx is number of 64-byte blocks to process
|
||||
// @see X86_HAVE(SHA)
|
||||
.ftrace1
|
||||
sha1_transform_ni:
|
||||
.ftrace2
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
sub $FRAME_SIZE,%rsp
|
||||
shl $6,NUM_BLKS # convert to bytes
|
||||
jz .Ldone_hash
|
||||
|
|
|
@ -530,10 +530,11 @@ STACK_SIZE = _RSP + _RSP_SIZE
|
|||
########################################################################
|
||||
.text
|
||||
.balign 32
|
||||
.ftrace1
|
||||
sha256_transform_rorx:
|
||||
.ftrace2
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
pushq %rbx
|
||||
pushq %r12
|
||||
pushq %r13
|
||||
|
|
|
@ -80,9 +80,10 @@ Tim Chen <tim.c.chen@linux.intel.com>\n"
|
|||
// @param %rsi points to input data
|
||||
// @param %rdx is number of blocks to process
|
||||
// @see X86_HAVE(SHA)
|
||||
.ftrace1
|
||||
sha256_transform_ni:
|
||||
.ftrace2
|
||||
.leafprologue
|
||||
.profilable
|
||||
shl $6,NUM_BLKS # convert to bytes
|
||||
jz .Ldone_hash
|
||||
add DATA_PTR,NUM_BLKS # pointer to end of data
|
||||
|
|
|
@ -571,10 +571,11 @@ frame_size = frame_GPRSAVE + GPRSAVE_SIZE
|
|||
# of SHA512 message blocks.
|
||||
# "blocks" is the message length in SHA512 blocks
|
||||
########################################################################
|
||||
.ftrace1
|
||||
sha512_transform_rorx:
|
||||
.ftrace2
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
# Allocate Stack Space
|
||||
mov %rsp, %rax
|
||||
sub $frame_size, %rsp
|
||||
|
|
|
@ -23,9 +23,10 @@
|
|||
// @param RDI is wchar_t *s
|
||||
// @param EAX is unsigned length
|
||||
// @see libc/nexgen32e/strsak32.S
|
||||
.ftrace1
|
||||
tinywcslen:
|
||||
.ftrace2
|
||||
.leafprologue
|
||||
.profilable
|
||||
xor %eax,%eax
|
||||
1: cmpl $0,(%rdi,%rax,4)
|
||||
jz 2f
|
||||
|
|
|
@ -24,9 +24,10 @@
|
|||
// @param RSI is size_t n
|
||||
// @param EAX is unsigned length
|
||||
// @see libc/nexgen32e/strsak32.S
|
||||
.ftrace1
|
||||
tinywcsnlen:
|
||||
.ftrace2
|
||||
.leafprologue
|
||||
.profilable
|
||||
xor %eax,%eax
|
||||
1: cmp %esi,%eax
|
||||
jae 2f
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp API-MS-Win-Core-Synch-l1-2-0,__imp_WaitOnAddress,WaitOnAddress,111
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
WaitOnAddress:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_WaitOnAddress(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp API-MS-Win-Core-Synch-l1-2-0,__imp_WakeByAddressAll,WakeByAddressAll,113
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
WakeByAddressAll:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov %rdi,%rcx
|
||||
sub $32,%rsp
|
||||
call *__imp_WakeByAddressAll(%rip)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp API-MS-Win-Core-Synch-l1-2-0,__imp_WakeByAddressSingle,WakeByAddressSingle,116
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
WakeByAddressSingle:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov %rdi,%rcx
|
||||
sub $32,%rsp
|
||||
call *__imp_WakeByAddressSingle(%rip)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp MsWSock,__imp_AcceptEx,AcceptEx,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
AcceptEx:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_AcceptEx(%rip),%rax
|
||||
jmp __sysv2nt8
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp MsWSock,__imp_DisconnectEx,DisconnectEx,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
DisconnectEx:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_DisconnectEx(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp MsWSock,__imp_GetAcceptExSockaddrs,GetAcceptExSockaddrs,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
GetAcceptExSockaddrs:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_GetAcceptExSockaddrs(%rip),%rax
|
||||
jmp __sysv2nt8
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp MsWSock,__imp_TransmitFile,TransmitFile,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
TransmitFile:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_TransmitFile(%rip),%rax
|
||||
jmp __sysv2nt8
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp MsWSock,__imp_WSARecvEx,WSARecvEx,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
WSARecvEx:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_WSARecvEx(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp PowrProf,__imp_SetSuspendState,SetSuspendState,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
SetSuspendState:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_SetSuspendState(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_AccessCheck,AccessCheck,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
AccessCheck:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_AccessCheck(%rip),%rax
|
||||
jmp __sysv2nt8
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_AdjustTokenPrivileges,AdjustTokenPrivileges,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
AdjustTokenPrivileges:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_AdjustTokenPrivileges(%rip),%rax
|
||||
jmp __sysv2nt6
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_CreateProcessAsUserW,CreateProcessAsUserW,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
CreateProcessAsUser:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_CreateProcessAsUserW(%rip),%rax
|
||||
jmp __sysv2nt12
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_DeregisterEventSource,DeregisterEventSource,1239
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
DeregisterEventSource:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov %rdi,%rcx
|
||||
sub $32,%rsp
|
||||
call *__imp_DeregisterEventSource(%rip)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_DuplicateToken,DuplicateToken,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
DuplicateToken:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_DuplicateToken(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_DuplicateTokenEx,DuplicateTokenEx,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
DuplicateTokenEx:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_DuplicateTokenEx(%rip),%rax
|
||||
jmp __sysv2nt6
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_GetFileSecurityW,GetFileSecurityW,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
GetFileSecurity:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_GetFileSecurityW(%rip),%rax
|
||||
jmp __sysv2nt6
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_GetUserNameW,GetUserNameW,1381
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
GetUserName:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_GetUserNameW(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_ImpersonateSelf,ImpersonateSelf,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
ImpersonateSelf:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov %rdi,%rcx
|
||||
sub $32,%rsp
|
||||
call *__imp_ImpersonateSelf(%rip)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_InitiateShutdownW,InitiateShutdownW,1403
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
InitiateShutdown:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_InitiateShutdownW(%rip),%rax
|
||||
jmp __sysv2nt6
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_LookupPrivilegeValueW,LookupPrivilegeValueW,1432
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
LookupPrivilegeValue:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_LookupPrivilegeValueW(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_MapGenericMask,MapGenericMask,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
MapGenericMask:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_MapGenericMask(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_OpenProcessToken,OpenProcessToken,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
OpenProcessToken:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_OpenProcessToken(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_OpenThreadToken,OpenThreadToken,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
OpenThreadToken:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_OpenThreadToken(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_RegCloseKey,RegCloseKey,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
RegCloseKey:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov %rdi,%rcx
|
||||
sub $32,%rsp
|
||||
call *__imp_RegCloseKey(%rip)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_RegConnectRegistryW,RegConnectRegistryW,1608
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
RegConnectRegistry:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_RegConnectRegistryW(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_RegCreateKeyExW,RegCreateKeyExW,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
RegCreateKeyEx:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_RegCreateKeyExW(%rip),%rax
|
||||
jmp __sysv2nt10
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_RegCreateKeyW,RegCreateKeyW,1616
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
RegCreateKey:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_RegCreateKeyW(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_RegDeleteKeyExW,RegDeleteKeyExW,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
RegDeleteKeyEx:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_RegDeleteKeyExW(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_RegDeleteKeyW,RegDeleteKeyW,1624
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
RegDeleteKey:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_RegDeleteKeyW(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_RegDeleteTreeW,RegDeleteTreeW,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
RegDeleteTree:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_RegDeleteTreeW(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_RegDeleteValueW,RegDeleteValueW,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
RegDeleteValue:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_RegDeleteValueW(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_RegDisablePredefinedCache,RegDisablePredefinedCache,1629
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
RegDisablePredefinedCache:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov %rdi,%rcx
|
||||
sub $32,%rsp
|
||||
call *__imp_RegDisablePredefinedCache(%rip)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_RegDisableReflectionKey,RegDisableReflectionKey,1631
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
RegDisableReflectionKey:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov %rdi,%rcx
|
||||
sub $32,%rsp
|
||||
call *__imp_RegDisableReflectionKey(%rip)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_RegEnableReflectionKey,RegEnableReflectionKey,1632
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
RegEnableReflectionKey:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov %rdi,%rcx
|
||||
sub $32,%rsp
|
||||
call *__imp_RegEnableReflectionKey(%rip)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_RegEnumKeyExW,RegEnumKeyExW,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
RegEnumKeyEx:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_RegEnumKeyExW(%rip),%rax
|
||||
jmp __sysv2nt8
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_RegEnumKeyW,RegEnumKeyW,1636
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
RegEnumKey:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_RegEnumKeyW(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_RegEnumValueW,RegEnumValueW,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
RegEnumValue:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_RegEnumValueW(%rip),%rax
|
||||
jmp __sysv2nt8
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_RegFlushKey,RegFlushKey,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
RegFlushKey:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov %rdi,%rcx
|
||||
sub $32,%rsp
|
||||
call *__imp_RegFlushKey(%rip)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_RegGetKeySecurity,RegGetKeySecurity,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
RegGetKeySecurity:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_RegGetKeySecurity(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
.imp advapi32,__imp_RegGetValueW,RegGetValueW,0
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
RegGetValue:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_RegGetValueW(%rip),%rax
|
||||
jmp __sysv2nt8
|
||||
#elif defined(__aarch64__)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue