mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 11:18:30 +00:00
Get us closer to building busybox
This change undefines __linux__ and adds APIs like clock_settime(). The gosh darned getopt_long() API has been reintroduced, thanks to OpenBSD.
This commit is contained in:
parent
5ac522f0de
commit
0409096658
52 changed files with 914 additions and 37 deletions
|
@ -244,8 +244,16 @@ static void OptimizePatchableFunctionEntries(void) {
|
|||
if (!(p = GetElfSectionAddress(elf, esize, shdr))) {
|
||||
Die("elf header overflow");
|
||||
}
|
||||
p += syms[i].st_value - shdr->sh_addr;
|
||||
pe = p + syms[i].st_size;
|
||||
if (syms[i].st_value < shdr->sh_addr) {
|
||||
Die("elf symbol beneath section");
|
||||
}
|
||||
if ((syms[i].st_value - shdr->sh_addr > esize ||
|
||||
(p += syms[i].st_value - shdr->sh_addr) >=
|
||||
(unsigned char *)elf + esize) ||
|
||||
(syms[i].st_size >= esize ||
|
||||
(pe = p + syms[i].st_size) >= (unsigned char *)elf + esize)) {
|
||||
Die("elf symbol overflow");
|
||||
};
|
||||
for (; p + 1 < pe; p += n) {
|
||||
if (p[0] != 0x90) break;
|
||||
if (p[1] != 0x90) break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue