Changeset View
Changeset View
Standalone View
Standalone View
lib/csu/common/ignore_init.c
Show All 26 Lines | |||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/elf.h> | #include <sys/elf.h> | ||||
#include <sys/elf_common.h> | #include <sys/elf_common.h> | ||||
#include "notes.h" | |||||
extern int main(int, char **, char **); | extern int main(int, char **, char **); | ||||
extern void (*__preinit_array_start[])(int, char **, char **) __hidden; | extern void (*__preinit_array_start[])(int, char **, char **) __hidden; | ||||
extern void (*__preinit_array_end[])(int, char **, char **) __hidden; | extern void (*__preinit_array_end[])(int, char **, char **) __hidden; | ||||
extern void (*__init_array_start[])(int, char **, char **) __hidden; | extern void (*__init_array_start[])(int, char **, char **) __hidden; | ||||
extern void (*__init_array_end[])(int, char **, char **) __hidden; | extern void (*__init_array_end[])(int, char **, char **) __hidden; | ||||
extern void (*__fini_array_start[])(void) __hidden; | extern void (*__fini_array_start[])(void) __hidden; | ||||
extern void (*__fini_array_end[])(void) __hidden; | extern void (*__fini_array_end[])(void) __hidden; | ||||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | if (argc > 0 && argv[0] != NULL) { | ||||
__progname = argv[0]; | __progname = argv[0]; | ||||
for (s = __progname; *s != '\0'; s++) { | for (s = __progname; *s != '\0'; s++) { | ||||
if (*s == '/') | if (*s == '/') | ||||
__progname = s + 1; | __progname = s + 1; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
static const struct { | __asm( | ||||
int32_t namesz; | " .section .note.tag,\"a\",@note\n" | ||||
int32_t descsz; | " .p2align 2\n" | ||||
int32_t type; | " .word 8\n" | ||||
char name[sizeof(NOTE_FREEBSD_VENDOR)]; | " .word 4\n" | ||||
emaste: I wonder if we could make this 0? | |||||
jhbAuthorUnsubmitted Done Inline ActionsThat's a good question. I'd rather do that as a separate change if so though. jhb: That's a good question. I'd rather do that as a separate change if so though. | |||||
uint32_t desc; | " .word " __XSTRING(NT_FREEBSD_NOINIT_TAG) "\n" | ||||
} crt_noinit_tag __attribute__ ((section (NOTE_SECTION), | " .asciz \"FreeBSD\"\n" | ||||
aligned(4))) __used = { | " .p2align 2\n" | ||||
.namesz = sizeof(NOTE_FREEBSD_VENDOR), | " .word 0"); | ||||
.descsz = sizeof(uint32_t), | |||||
.type = NT_FREEBSD_NOINIT_TAG, | |||||
.name = NOTE_FREEBSD_VENDOR, | |||||
.desc = 0 | |||||
}; |
I wonder if we could make this 0?