Perform some code cleanup

This commit is contained in:
Justine Tunney 2021-02-27 10:33:32 -08:00
parent 3e17c7b20f
commit 19d0c15e03
41 changed files with 321 additions and 459 deletions

View file

@ -44,7 +44,7 @@
#include "libc/runtime/pc.internal.h"
#include "libc/sysv/consts/prot.h"
#define USE_SYMBOL_HACK 0
#define USE_SYMBOL_HACK 1
.section .text,"ax",@progbits
.align __SIZEOF_POINTER__
@ -1486,12 +1486,6 @@ ape_pad_text:
ape_pad_privileged:
.previous
.section .ape.pad.test,"a",@progbits
.type ape_pad_test,@object
.hidden ape_pad_test
ape_pad_test:
.previous
.section .ape.pad.rodata,"a",@progbits
.type ape_pad_rodata,@object
.hidden ape_pad_rodata

View file

@ -238,9 +238,8 @@ SECTIONS {
/* Code that needs to be addressable in Real Mode */
*(.text.real)
KEEP(*(SORT_BY_NAME(.sort.text.real.*)))
/**(.rodata.real)
KEEP(*(SORT_BY_NAME(.sort.rodata.real.*)))*/
HIDDEN(_ereal = .);
. += 1;
/*END: realmode addressability guarantee */
@ -273,16 +272,17 @@ SECTIONS {
KEEP(*(SORT_BY_NAME(.sort.text.*)))
KEEP(*(.ape.pad.test));
HIDDEN(__test_start = .);
*(.test.unlikely)
*(.test .test.*)
/* Privileged code invulnerable to magic */
KEEP(*(.ape.pad.privileged));
. += . > 0 ? 1 : 0;
HIDDEN(__privileged_start = .);
HIDDEN(__test_end = .);
. += . > 0 ? 1 : 0;
*(.privileged)
HIDDEN(__privileged_end = .);
. += . > 0 ? 1 : 0;
/*BEGIN: Read Only Data */
@ -302,7 +302,7 @@ SECTIONS {
KEEP(*(.comment))
KEEP(*(.commentepilogue))
#endif
/* Windows DLL Import Directory */
KEEP(*(.idata.ro));
KEEP(*(SORT_BY_NAME(.idata.ro.*)))
@ -369,6 +369,7 @@ SECTIONS {
*(.piro.bss)
KEEP(*(SORT_BY_NAME(.piro.bss.sort.*)))
HIDDEN(__piro_end = .);
. += . > 0 ? 1 : 0;
/*END: Post-Initialization Read-Only */
/* Statically Allocated Empty Space */
@ -378,7 +379,7 @@ SECTIONS {
KEEP(*(SORT_BY_NAME(.sort.bss.*)))
. = ALIGN(0x10000); /* for brk()/sbrk() allocation */
. = ALIGN(FRAMESIZE); /* for brk()/sbrk() allocation */
HIDDEN(_end = .);
PROVIDE_HIDDEN(end = .);
} :Ram