mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-16 07:39:56 +00:00
Trim down executable sizes
This commit is contained in:
parent
ec69413f83
commit
bfa8581537
19 changed files with 1176 additions and 131 deletions
|
@ -30,9 +30,11 @@ void LoadDebugSymbols(struct Elf *elf) {
|
|||
int fd;
|
||||
void *elfmap;
|
||||
struct stat st;
|
||||
const char *path;
|
||||
if (elf->ehdr) return;
|
||||
DCHECK_NOTNULL(elf->prog);
|
||||
if ((fd = open(gc(xstrcat(elf->prog, ".dbg")), O_RDONLY)) != -1) {
|
||||
if ((fd = open(gc(xstrcat(elf->prog, ".dbg")), O_RDONLY)) != -1 ||
|
||||
(fd = open(elf->prog, O_RDONLY))) {
|
||||
if (fstat(fd, &st) != -1 &&
|
||||
(elfmap = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0)) !=
|
||||
MAP_FAILED) {
|
||||
|
|
|
@ -199,7 +199,6 @@ long DisFindSymByName(struct Dis *d, const char *s) {
|
|||
}
|
||||
|
||||
void DisLoadElf(struct Dis *d, struct Elf *elf) {
|
||||
LOGF("DisLoadElf");
|
||||
if (!elf || !elf->ehdr) return;
|
||||
DisLoadElfLoads(d, elf);
|
||||
DisLoadElfSyms(d, elf);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue