Mint APE Loader v1.5

This change ports APE Loader to Linux AARCH64, so that Raspberry Pi
users can run programs like redbean, without the executable needing
to modify itself. Progress has also slipped into this change on the
issue of making progress better conforming to user expectations and
industry standards regarding which symbols we're allowed to declare
This commit is contained in:
Justine Tunney 2023-07-26 13:54:49 -07:00
parent 6843150e0c
commit 7e0a09feec
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
510 changed files with 1783 additions and 1483 deletions

View file

@ -1,2 +0,0 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_BASE,7,7,7,7,7,0,7,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_BASE_PLATFORM,24,24,0,0,0,0,0,0
.syscon auxv,AT_BASE_PLATFORM,24,24,0,0,0,24,0,24

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_CLKTCK,17,17,0,0,0,0,0,0
.syscon auxv,AT_CLKTCK,17,17,0,0,0,17,0,17

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_DCACHEBSIZE,19,19,0,0,0,0,0,0
.syscon auxv,AT_DCACHEBSIZE,19,19,0,0,0,19,0,19

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_EGID,14,14,14,14,0,0,2002,0
.syscon auxv,AT_EGID,14,14,14,14,0,14,2002,14

View file

@ -1,2 +0,0 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_ENTRY,9,9,9,9,9,0,9,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_EUID,12,12,12,12,0,0,2000,0
.syscon auxv,AT_EUID,12,12,12,12,0,12,2000,12

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_EXECFD,2,2,0,0,2,0,2,0
.syscon auxv,AT_EXECFD,2,2,0,0,2,2,2,2

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_EXECFN,31,31,31,31,15,999,2014,31
.syscon auxv,AT_EXECFN,31,31,31,31,15,31,2014,31

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_EXECPATH,31,31,31,31,15,999,2014,31
.syscon auxv,AT_EXECPATH,31,31,31,31,15,31,2014,31

View file

@ -1,2 +0,0 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_FLAGS,8,8,0,0,8,0,8,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_GID,13,13,13,13,0,0,2003,0
.syscon auxv,AT_GID,13,13,13,13,0,13,2003,13

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_HWCAP,16,16,16,16,0,0,0,0
.syscon auxv,AT_HWCAP,16,16,16,16,0,16,0,16

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_HWCAP2,26,26,26,26,0,0,0,0
.syscon auxv,AT_HWCAP2,26,26,26,26,0,26,0,26

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_ICACHEBSIZE,20,20,0,0,0,0,0,0
.syscon auxv,AT_ICACHEBSIZE,20,20,0,0,0,20,0,20

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_MINSIGSTKSZ,51,51,0,0,0,0,0,0
.syscon auxv,AT_MINSIGSTKSZ,51,51,0,0,0,51,0,51

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_NOTELF,10,10,0,0,10,0,0,0
.syscon auxv,AT_NOTELF,10,10,0,0,10,10,0,10

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_NO_AUTOMOUNT,0x0800,0x0800,0,0,0,0,0,0
.syscon auxv,AT_NO_AUTOMOUNT,0x0800,0x0800,0,0,0,0x0800,0,0x0800

View file

@ -1,2 +0,0 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_PAGESZ,6,6,6,6,6,0,6,0

View file

@ -1,2 +0,0 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_PHDR,3,3,3,3,3,0,3,0

View file

@ -1,2 +0,0 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_PHENT,4,4,4,4,4,0,4,0

View file

@ -1,2 +0,0 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_PHNUM,5,5,5,5,5,0,5,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_PLATFORM,15,15,0,0,0,0,0,0
.syscon auxv,AT_PLATFORM,15,15,0,0,0,15,0,15

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_RANDOM,25,25,25,25,16,0,0,0
.syscon auxv,AT_RANDOM,25,25,25,25,16,25,0,25

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_SECURE,23,23,23,23,0,0,0,0
.syscon auxv,AT_SECURE,23,23,23,23,0,23,0,23

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_SYSINFO_EHDR,33,33,0,0,0,0,0,0
.syscon auxv,AT_SYSINFO_EHDR,33,33,0,0,0,33,0,33

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_UCACHEBSIZE,21,21,0,0,0,0,0,0
.syscon auxv,AT_UCACHEBSIZE,21,21,0,0,0,21,0,21

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_UID,11,11,11,11,0,0,2001,0
.syscon auxv,AT_UID,11,11,11,11,0,11,2001,11

View file

@ -1,25 +1,53 @@
#ifndef COSMOPOLITAN_LIBC_CALLS_AUXV_H_
#define COSMOPOLITAN_LIBC_CALLS_AUXV_H_
/*
* integral getauxval() keys
*/
#define AT_PHDR 3
#define AT_PHENT 4
#define AT_PHNUM 5
#define AT_PAGESZ 6
#define AT_BASE 7
#define AT_FLAGS 8
#define AT_ENTRY 9
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const unsigned long AT_BASE;
/*
* portable getauxval() keys
*/
extern const unsigned long AT_EXECFN;
extern const unsigned long AT_SECURE;
extern const unsigned long AT_RANDOM;
extern const unsigned long AT_HWCAP;
extern const unsigned long AT_HWCAP2;
extern const unsigned long AT_UID;
extern const unsigned long AT_EUID;
extern const unsigned long AT_GID;
extern const unsigned long AT_EGID;
#define AT_EXECFN AT_EXECFN
#define AT_SECURE AT_SECURE
#define AT_RANDOM AT_RANDOM
#define AT_HWCAP AT_HWCAP
#define AT_HWCAP2 AT_HWCAP2
#define AT_UID AT_UID
#define AT_EUID AT_EUID
#define AT_GID AT_GID
#define AT_EGID AT_EGID
/*
* platform-specific getauxval() keys
*/
extern const unsigned long AT_BASE_PLATFORM;
extern const unsigned long AT_CANARY;
extern const unsigned long AT_CANARYLEN;
extern const unsigned long AT_CLKTCK;
extern const unsigned long AT_DCACHEBSIZE;
extern const unsigned long AT_EGID;
extern const unsigned long AT_EHDRFLAGS;
extern const unsigned long AT_ENTRY;
extern const unsigned long AT_EUID;
extern const unsigned long AT_EXECFD;
extern const unsigned long AT_EXECFN;
extern const unsigned long AT_EXECPATH;
extern const unsigned long AT_FLAGS;
extern const unsigned long AT_GID;
extern const unsigned long AT_HWCAP2;
extern const unsigned long AT_HWCAP;
extern const unsigned long AT_ICACHEBSIZE;
extern const unsigned long AT_MINSIGSTKSZ;
extern const unsigned long AT_NCPUS;
@ -28,61 +56,13 @@ extern const unsigned long AT_NO_AUTOMOUNT;
extern const unsigned long AT_OSRELDATE;
extern const unsigned long AT_PAGESIZES;
extern const unsigned long AT_PAGESIZESLEN;
extern const unsigned long AT_PAGESZ;
extern const unsigned long AT_PHDR;
extern const unsigned long AT_PHENT;
extern const unsigned long AT_PHNUM;
extern const unsigned long AT_PLATFORM;
extern const unsigned long AT_RANDOM;
extern const unsigned long AT_SECURE;
extern const unsigned long AT_STACKBASE;
extern const unsigned long AT_STACKPROT;
extern const unsigned long AT_SYSINFO_EHDR;
extern const unsigned long AT_TIMEKEEP;
extern const unsigned long AT_UCACHEBSIZE;
extern const unsigned long AT_UID;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define AT_BASE AT_BASE
#define AT_BASE_PLATFORM AT_BASE_PLATFORM
#define AT_CANARY AT_CANARY
#define AT_CANARYLEN AT_CANARYLEN
#define AT_CLKTCK AT_CLKTCK
#define AT_DCACHEBSIZE AT_DCACHEBSIZE
#define AT_EGID AT_EGID
#define AT_EHDRFLAGS AT_EHDRFLAGS
#define AT_ENTRY AT_ENTRY
#define AT_EUID AT_EUID
#define AT_EXECFD AT_EXECFD
#define AT_EXECFN AT_EXECFN
#define AT_EXECPATH AT_EXECPATH
#define AT_FLAGS AT_FLAGS
#define AT_GID AT_GID
#define AT_HWCAP AT_HWCAP
#define AT_HWCAP2 AT_HWCAP2
#define AT_ICACHEBSIZE AT_ICACHEBSIZE
#define AT_MINSIGSTKSZ AT_MINSIGSTKSZ
#define AT_NCPUS AT_NCPUS
#define AT_NOTELF AT_NOTELF
#define AT_NO_AUTOMOUNT AT_NO_AUTOMOUNT
#define AT_OSRELDATE AT_OSRELDATE
#define AT_PAGESIZES AT_PAGESIZES
#define AT_PAGESIZESLEN AT_PAGESIZESLEN
#define AT_PAGESZ AT_PAGESZ
#define AT_PHDR AT_PHDR
#define AT_PHENT AT_PHENT
#define AT_PHNUM AT_PHNUM
#define AT_PLATFORM AT_PLATFORM
#define AT_RANDOM AT_RANDOM
#define AT_SECURE AT_SECURE
#define AT_STACKBASE AT_STACKBASE
#define AT_STACKPROT AT_STACKPROT
#define AT_SYSINFO_EHDR AT_SYSINFO_EHDR
#define AT_TIMEKEEP AT_TIMEKEEP
#define AT_UCACHEBSIZE AT_UCACHEBSIZE
#define AT_UID AT_UID
#endif /* COSMOPOLITAN_LIBC_CALLS_AUXV_H_ */