17
17
│ PERFORMANCE OF THIS SOFTWARE. │
18
18
╚─────────────────────────────────────────────────────────────────────────────*/
19
19
#include "libc/calls/calls.h"
20
+ #include "libc/calls/internal.h"
20
21
#include "libc/calls/struct/stat.h"
21
22
#include "libc/elf/elf.h"
22
23
#include "libc/log/check.h"
23
24
#include "libc/runtime/gc.h"
25
+ #include "libc/stdio/stdio.h"
24
26
#include "libc/sysv/consts/map.h"
25
27
#include "libc/sysv/consts/o.h"
26
28
#include "libc/sysv/consts/prot.h"
@@ -35,15 +37,14 @@ void LoadDebugSymbols(struct Elf *elf) {
35
37
const char * path ;
36
38
if (elf -> ehdr && GetElfSymbolTable (elf -> ehdr , elf -> size , & n ) && n ) return ;
37
39
DCHECK_NOTNULL (elf -> prog );
38
- fprintf (stderr , "HI %s\n" , elf -> prog );
39
- if ((fd = open (gc (xstrcat (elf -> prog , ".dbg" )), O_RDONLY )) != -1 ||
40
- (fd = open (elf -> prog , O_RDONLY )) != -1 ) {
40
+ if ((fd = open (xstrcat (elf -> prog , ".dbg" ), O_RDONLY )) != -1 ) {
41
41
if (fstat (fd , & st ) != -1 &&
42
- (elfmap = mmap (NULL , st .st_size , PROT_READ , MAP_SHARED , fd , 0 )) !=
42
+ (elfmap = mmap (NULL , st .st_size , PROT_READ , MAP_PRIVATE , fd , 0 )) !=
43
43
MAP_FAILED ) {
44
44
elf -> ehdr = elfmap ;
45
45
elf -> size = st .st_size ;
46
46
}
47
47
close (fd );
48
48
}
49
+ fprintf (stderr , "got here\n" );
49
50
}
0 commit comments