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 89 Lines • ▼ Show 20 Lines | if (environ == NULL) | ||||
environ = env; | environ = env; | ||||
if (argc > 0 && argv[0] != NULL) { | 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; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
emaste: I wonder if we could make this 0? | |||||
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. | |||||
static const struct { | |||||
int32_t namesz; | |||||
int32_t descsz; | |||||
int32_t type; | |||||
char name[sizeof(NOTE_FREEBSD_VENDOR)]; | |||||
uint32_t desc; | |||||
} crt_noinit_tag __attribute__ ((section (NOTE_SECTION), | |||||
aligned(4))) __used = { | |||||
.namesz = sizeof(NOTE_FREEBSD_VENDOR), | |||||
.descsz = sizeof(uint32_t), | |||||
.type = NT_FREEBSD_NOINIT_TAG, | |||||
.name = NOTE_FREEBSD_VENDOR, | |||||
.desc = 0 | |||||
}; |
I wonder if we could make this 0?