sync with OpenBSD -current
This commit is contained in:
parent
659ea2942e
commit
0f27a61c5c
131 changed files with 2461 additions and 5218 deletions
|
@ -1,4 +1,4 @@
|
|||
# $OpenBSD: Makefile,v 1.85 2023/07/08 11:03:45 jasper Exp $
|
||||
# $OpenBSD: Makefile,v 1.86 2023/12/20 14:54:29 deraadt Exp $
|
||||
|
||||
SUBDIR=ldconfig ldd
|
||||
MAN= ld.so.1
|
||||
|
@ -29,7 +29,8 @@ SRCS+= malloc.c reallocarray.c tib.c ffs.c
|
|||
|
||||
syscall=close exit fstat getdents getentropy getthrid issetugid kbind \
|
||||
mimmutable mmap mprotect munmap msyscall open pledge pinsyscall \
|
||||
read __realpath sendsyslog __set_tcb sysctl thrkill utrace write
|
||||
pinsyscalls read __realpath sendsyslog __set_tcb sysctl thrkill \
|
||||
utrace write
|
||||
|
||||
.if (${MACHINE_ARCH} == "i386")
|
||||
syscall+=mquery
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
PHDRS
|
||||
{
|
||||
rodata PT_LOAD FILEHDR PHDRS FLAGS (4);
|
||||
text PT_LOAD FLAGS (1);
|
||||
btext PT_LOAD FLAGS (0x08000001);
|
||||
text PT_LOAD FLAGS (1);
|
||||
data PT_LOAD;
|
||||
random PT_OPENBSD_RANDOMIZE;
|
||||
syscalls PT_OPENBSD_SYSCALLS;
|
||||
|
@ -23,8 +23,6 @@ SECTIONS
|
|||
|
||||
/* TEXT */
|
||||
. = ALIGN(0x10000);
|
||||
.text : { *(.text .text.*) } :text
|
||||
. = ALIGN(0x1000);
|
||||
.boot.text :
|
||||
{
|
||||
. = ALIGN(0x1000);
|
||||
|
@ -33,6 +31,8 @@ SECTIONS
|
|||
. = ALIGN(0x1000);
|
||||
boot_text_end = .;
|
||||
} :btext
|
||||
. = ALIGN(0x1000);
|
||||
.text : { *(.text .text.*) } :text
|
||||
|
||||
/* RELRO DATA */
|
||||
. = DATA_SEGMENT_ALIGN (0x10000, 0x1000);
|
||||
|
|
|
@ -23,8 +23,6 @@ SECTIONS
|
|||
|
||||
/* TEXT */
|
||||
. = ALIGN(0x10000);
|
||||
.text : { *(.text .text.*) } :text
|
||||
. = ALIGN(0x2000);
|
||||
.boot.text :
|
||||
{
|
||||
. = ALIGN(0x2000);
|
||||
|
@ -33,6 +31,8 @@ SECTIONS
|
|||
*(.boot.text)
|
||||
boot_text_end = .;
|
||||
} :btext
|
||||
. = ALIGN(0x2000);
|
||||
.text : { *(.text .text.*) } :text
|
||||
|
||||
/* RELRO DATA */
|
||||
. = DATA_SEGMENT_ALIGN (0x10000, 0x2000);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
PHDRS
|
||||
{
|
||||
rodata PT_LOAD FILEHDR PHDRS FLAGS (4);
|
||||
text PT_LOAD FLAGS (1);
|
||||
btext PT_LOAD FLAGS (0x08000005);
|
||||
text PT_LOAD FLAGS (1);
|
||||
data PT_LOAD;
|
||||
random PT_OPENBSD_RANDOMIZE;
|
||||
syscalls PT_OPENBSD_SYSCALLS;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
PHDRS
|
||||
{
|
||||
rodata PT_LOAD FILEHDR PHDRS FLAGS (4);
|
||||
text PT_LOAD;
|
||||
btext PT_LOAD FLAGS (0x08000005);
|
||||
text PT_LOAD;
|
||||
data PT_LOAD;
|
||||
random PT_OPENBSD_RANDOMIZE;
|
||||
syscalls PT_OPENBSD_SYSCALLS;
|
||||
|
@ -24,8 +24,6 @@ SECTIONS
|
|||
|
||||
/* TEXT */
|
||||
. = ALIGN(0x10000);
|
||||
.text : { *(.text .text.*) } :text
|
||||
. = ALIGN(0x1000);
|
||||
.boot.text :
|
||||
{
|
||||
. = ALIGN(0x1000);
|
||||
|
@ -34,6 +32,8 @@ SECTIONS
|
|||
. = ALIGN(0x1000);
|
||||
boot_text_end = .;
|
||||
} :btext
|
||||
. = ALIGN(0x1000);
|
||||
.text : { *(.text .text.*) } :text
|
||||
|
||||
/* RELRO DATA */
|
||||
. = DATA_SEGMENT_ALIGN (0x10000, 0x1000);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: dlfcn.c,v 1.115 2023/08/15 06:26:34 guenther Exp $ */
|
||||
/* $OpenBSD: dlfcn.c,v 1.116 2023/12/19 16:13:22 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
|
||||
|
@ -44,7 +44,7 @@ static int _dl_real_close(void *handle);
|
|||
static lock_cb *_dl_thread_fnc = NULL;
|
||||
static elf_object_t *obj_from_addr(const void *addr);
|
||||
|
||||
#define OK_FLAGS (0 \
|
||||
#define OK_FLAGS (0 \
|
||||
| RTLD_TRACE \
|
||||
| RTLD_LAZY \
|
||||
| RTLD_NOW \
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
PHDRS
|
||||
{
|
||||
rodata PT_LOAD FILEHDR PHDRS FLAGS (4);
|
||||
text PT_LOAD FLAGS (1);
|
||||
btext PT_LOAD FLAGS (0x08000005);
|
||||
text PT_LOAD FLAGS (1);
|
||||
pltgot PT_LOAD;
|
||||
data PT_LOAD;
|
||||
random PT_OPENBSD_RANDOMIZE;
|
||||
|
@ -24,8 +24,6 @@ SECTIONS
|
|||
|
||||
/* TEXT */
|
||||
. = ALIGN(0x1000);
|
||||
.text : { *(.text .text.*) } :text
|
||||
. = ALIGN(0x1000);
|
||||
.boot.text :
|
||||
{
|
||||
. = ALIGN(0x1000);
|
||||
|
@ -34,6 +32,8 @@ SECTIONS
|
|||
. = ALIGN(0x1000);
|
||||
boot_text_end = .;
|
||||
} :btext
|
||||
. = ALIGN(0x1000);
|
||||
.text : { *(.text .text.*) } :text
|
||||
|
||||
/* PLT and GOT */
|
||||
. = ALIGN(0x1000);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
PHDRS
|
||||
{
|
||||
rodata PT_LOAD FILEHDR PHDRS FLAGS (4);
|
||||
text PT_LOAD FLAGS (1);
|
||||
btext PT_LOAD FLAGS (0x08000005);
|
||||
text PT_LOAD FLAGS (1);
|
||||
data PT_LOAD;
|
||||
random PT_OPENBSD_RANDOMIZE;
|
||||
syscalls PT_OPENBSD_SYSCALLS;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: library.c,v 1.92 2023/08/15 06:23:31 guenther Exp $ */
|
||||
/* $OpenBSD: library.c,v 1.93 2023/12/19 16:13:22 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 Dale Rahn
|
||||
|
@ -316,7 +316,6 @@ _dl_tryload_shlib(const char *libname, int type, int flags, int nodelete)
|
|||
_dl_push_range_size(&mut, phdp->p_vaddr + loff,
|
||||
phdp->p_memsz);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: library_mquery.c,v 1.72 2023/08/15 06:23:31 guenther Exp $ */
|
||||
/* $OpenBSD: library_mquery.c,v 1.73 2023/12/19 16:13:22 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 Dale Rahn
|
||||
|
@ -60,7 +60,6 @@ _dl_load_list_free(struct load_list *load_list)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_dl_unload_shlib(elf_object_t *object)
|
||||
{
|
||||
|
@ -99,7 +98,6 @@ unload:
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
elf_object_t *
|
||||
_dl_tryload_shlib(const char *libname, int type, int flags, int nodelete)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: loader.c,v 1.216 2023/12/18 17:19:07 deraadt Exp $ */
|
||||
/* $OpenBSD: loader.c,v 1.218 2023/12/19 16:13:22 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
|
||||
|
@ -171,7 +171,6 @@ _dl_run_all_dtors(void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
for (node = _dl_objects;
|
||||
node != NULL;
|
||||
node = node->next ) {
|
||||
|
@ -483,8 +482,8 @@ __asm__(".pushsection .openbsd.syscalls,\"\",%progbits;"
|
|||
".popsection");
|
||||
#else
|
||||
__asm__(".pushsection .openbsd.syscalls,\"\",@progbits;"
|
||||
".long 0;"
|
||||
".p2align 2;"
|
||||
".long 0;"
|
||||
".long " STRINGIFY(SYS_kbind) ";"
|
||||
".popsection");
|
||||
#endif
|
||||
|
@ -1139,5 +1138,4 @@ _dl_apply_immutable(elf_object_t *object)
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
PHDRS
|
||||
{
|
||||
rodata PT_LOAD FILEHDR PHDRS FLAGS (4);
|
||||
text PT_LOAD;
|
||||
btext PT_LOAD FLAGS (0x08000005);
|
||||
text PT_LOAD;
|
||||
data PT_LOAD;
|
||||
random PT_OPENBSD_RANDOMIZE;
|
||||
syscalls PT_OPENBSD_SYSCALLS;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
PHDRS
|
||||
{
|
||||
rodata PT_LOAD FILEHDR PHDRS FLAGS (4);
|
||||
text PT_LOAD FLAGS (1);
|
||||
btext PT_LOAD FLAGS (0x08000005);
|
||||
text PT_LOAD FLAGS (1);
|
||||
data PT_LOAD;
|
||||
random PT_OPENBSD_RANDOMIZE;
|
||||
syscalls PT_OPENBSD_SYSCALLS;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
PHDRS
|
||||
{
|
||||
rodata PT_LOAD FILEHDR PHDRS FLAGS (4);
|
||||
text PT_LOAD FLAGS (1);
|
||||
btext PT_LOAD FLAGS (0x08000005);
|
||||
text PT_LOAD FLAGS (1);
|
||||
data PT_LOAD;
|
||||
random PT_OPENBSD_RANDOMIZE;
|
||||
syscalls PT_OPENBSD_SYSCALLS;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: resolve.h,v 1.105 2023/08/15 06:26:34 guenther Exp $ */
|
||||
/* $OpenBSD: resolve.h,v 1.106 2023/12/19 16:13:22 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
|
||||
|
@ -73,7 +73,7 @@ typedef struct elf_object elf_object_t;
|
|||
struct object_vector {
|
||||
int len;
|
||||
int alloc;
|
||||
elf_object_t **vec;
|
||||
elf_object_t **vec;
|
||||
};
|
||||
void object_vec_grow(struct object_vector *_vec, int _more);
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
PHDRS
|
||||
{
|
||||
rodata PT_LOAD FILEHDR PHDRS FLAGS (4);
|
||||
text PT_LOAD FLAGS (1);
|
||||
btext PT_LOAD FLAGS (0x08000005);
|
||||
text PT_LOAD FLAGS (1);
|
||||
data PT_LOAD;
|
||||
random PT_OPENBSD_RANDOMIZE;
|
||||
syscalls PT_OPENBSD_SYSCALLS;
|
||||
|
@ -23,8 +23,6 @@ SECTIONS
|
|||
|
||||
/* TEXT */
|
||||
. = ALIGN(0x10000);
|
||||
.text : { *(.text .text.*) } :text
|
||||
. = ALIGN(0x1000);
|
||||
.boot.text :
|
||||
{
|
||||
. = ALIGN(0x1000);
|
||||
|
@ -33,6 +31,8 @@ SECTIONS
|
|||
. = ALIGN(0x1000);
|
||||
boot_text_end = .;
|
||||
} :btext
|
||||
. = ALIGN(0x1000);
|
||||
.text : { *(.text .text.*) } :text
|
||||
|
||||
/* RELRO DATA */
|
||||
. = DATA_SEGMENT_ALIGN (0x10000, 0x1000);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
PHDRS
|
||||
{
|
||||
rodata PT_LOAD FILEHDR PHDRS FLAGS (4);
|
||||
text PT_LOAD FLAGS (5); /* architecturally required data islands */
|
||||
btext PT_LOAD FLAGS (0x08000005);
|
||||
text PT_LOAD FLAGS (5); /* architecturally required data islands */
|
||||
data PT_LOAD;
|
||||
random PT_OPENBSD_RANDOMIZE;
|
||||
syscalls PT_OPENBSD_SYSCALLS;
|
||||
|
@ -23,14 +23,14 @@ SECTIONS
|
|||
|
||||
/* TEXT */
|
||||
. = ALIGN (0x1000);
|
||||
.text : { *(.text .text.*) } :text =0xc3c3c3c3
|
||||
. = ALIGN (0x1000);
|
||||
.boot.text :
|
||||
{
|
||||
boot_text_start = .;
|
||||
*(.boot.text)
|
||||
boot_text_end = .;
|
||||
} :btext
|
||||
. = ALIGN (0x1000);
|
||||
.text : { *(.text .text.*) } :text =0xc3c3c3c3
|
||||
|
||||
/* RELRO DATA */
|
||||
. = DATA_SEGMENT_ALIGN (0x10000, 0x1000);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
PHDRS
|
||||
{
|
||||
rodata PT_LOAD FILEHDR PHDRS FLAGS (4);
|
||||
text PT_LOAD FLAGS (1);
|
||||
btext PT_LOAD FLAGS (0x08000005);
|
||||
text PT_LOAD FLAGS (1);
|
||||
data PT_LOAD;
|
||||
random PT_OPENBSD_RANDOMIZE;
|
||||
syscalls PT_OPENBSD_SYSCALLS;
|
||||
|
@ -31,7 +31,7 @@ SECTIONS
|
|||
. = ALIGN(0x2000);
|
||||
boot_text_end = .;
|
||||
} :btext =0
|
||||
. = ALIGN(0x100000);
|
||||
. = ALIGN(0x2000);
|
||||
.text : { *(.text .text.*) } :text =0
|
||||
|
||||
/* RELRO DATA */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: syscall.h,v 1.5 2023/12/12 17:39:14 deraadt Exp $ */
|
||||
/* $OpenBSD: syscall.h,v 1.6 2023/12/20 14:54:29 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
|
||||
|
@ -52,6 +52,7 @@ int _dl_mprotect(const void *, size_t, int);
|
|||
void *_dl_mquery(void *, size_t, int, int, int, off_t);
|
||||
int _dl_msyscall(void *addr, size_t len);
|
||||
int _dl_pinsyscall(int, void *addr, size_t len);
|
||||
int _dl_pinsyscalls(void *base, size_t len, u_int *pin, int pinlen);
|
||||
int _dl_munmap(const void *, size_t);
|
||||
int _dl_mimmutable(const void *, size_t);
|
||||
int _dl_open(const char *, int);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue