mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 19:58:30 +00:00
Clean up some code
- Use good ELF technique in cosmo_dlopen() - Make strerror() conform more to other libc impls - Introduce __clear_cache() and use it in cosmo_dlopen() - Remove libc/fmt/fmt.h header (trying to kill off LIBC_FMT)
This commit is contained in:
parent
7010a8081e
commit
68c7c9c1e0
244 changed files with 378 additions and 588 deletions
|
@ -19,7 +19,6 @@
|
|||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/syscall-sysv.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/log/color.internal.h"
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/intrin/weaken.h"
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
|
@ -32,8 +31,6 @@
|
|||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
__static_yoink("strerror_wr");
|
||||
|
||||
/**
|
||||
* Handles failure of CHECK_xx() macros.
|
||||
*/
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/intrin/bsf.h"
|
||||
#include "libc/intrin/cxaatexit.internal.h"
|
||||
#include "libc/log/log.h"
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/log/gdb.h"
|
||||
#include "libc/log/log.h"
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/errno.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
|
|
|
@ -17,14 +17,13 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/stdio/dprintf.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/stdio/dprintf.h"
|
||||
|
||||
static void onmemchunk(void *start, void *end, size_t used_bytes, void *arg) {
|
||||
(dprintf)(*(int *)arg, "%p - %p : %08zx / %08lx\n", start, end, used_bytes,
|
||||
(intptr_t)end - (intptr_t)start);
|
||||
dprintf(*(int *)arg, "%p - %p : %08zx / %08lx\n", start, end, used_bytes,
|
||||
(intptr_t)end - (intptr_t)start);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -32,7 +31,6 @@ static void onmemchunk(void *start, void *end, size_t used_bytes, void *arg) {
|
|||
*/
|
||||
void _meminfo(int fd) {
|
||||
_memsummary(fd);
|
||||
(dprintf)(fd, "%*s %*s %*s %*s\n", POINTER_XDIGITS, "start",
|
||||
POINTER_XDIGITS, "end", 8, "used", 8, "size");
|
||||
dprintf(fd, "%12s %12s %8s %8s\n", "start", "end", "used", "size");
|
||||
malloc_inspect_all(onmemchunk, &fd);
|
||||
}
|
||||
|
|
|
@ -58,9 +58,6 @@
|
|||
#include "libc/thread/tls.h"
|
||||
#ifdef __x86_64__
|
||||
|
||||
__static_yoink("strerror_wr"); // for kprintf %m
|
||||
__static_yoink("strsignal_r"); // for kprintf %G
|
||||
|
||||
#define STACK_ERROR "error: not enough room on stack to print crash report\n"
|
||||
|
||||
static const char kGregOrder[17] forcealign(1) = {
|
||||
|
|
|
@ -51,9 +51,6 @@
|
|||
#include "libc/thread/thread.h"
|
||||
#ifdef __aarch64__
|
||||
|
||||
__static_yoink("strerror_wr"); // for kprintf %m
|
||||
__static_yoink("strsignal_r"); // for kprintf %G
|
||||
|
||||
#define STACK_ERROR "error: not enough room on stack to print crash report\n"
|
||||
|
||||
#define RESET "\e[0m"
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/fmt/libgen.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue