rtld: Revert "When loading dso without PT_GNU_STACK phdr, only call"

After the removal of ia64 and sparc64, all current architectures
support executable stacks at an architectural level.

This reverts commit 1290d38ac5.

Reviewed by:	kib
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D37904
This commit is contained in:
John Baldwin 2023-01-04 14:55:00 -08:00
parent 11905a0b4e
commit b069d3e019
9 changed files with 2 additions and 23 deletions

View File

@ -87,9 +87,6 @@ typedef struct {
extern void *__tls_get_addr(tls_index *ti); extern void *__tls_get_addr(tls_index *ti);
#define RTLD_DEFAULT_STACK_PF_EXEC PF_X
#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC
#define md_abi_variant_hook(x) #define md_abi_variant_hook(x)
#endif #endif

View File

@ -69,9 +69,6 @@ typedef struct {
void *__tls_get_addr(tls_index *ti) __exported; void *__tls_get_addr(tls_index *ti) __exported;
#define RTLD_DEFAULT_STACK_PF_EXEC PF_X
#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC
#define md_abi_variant_hook(x) #define md_abi_variant_hook(x)
size_t calculate_first_tls_offset(size_t size, size_t align, size_t offset); size_t calculate_first_tls_offset(size_t size, size_t align, size_t offset);

View File

@ -73,9 +73,6 @@ typedef struct {
extern void *__tls_get_addr(tls_index *ti); extern void *__tls_get_addr(tls_index *ti);
#define RTLD_DEFAULT_STACK_PF_EXEC PF_X
#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC
#define md_abi_variant_hook(x) #define md_abi_variant_hook(x)
#endif #endif

View File

@ -70,9 +70,6 @@ typedef struct {
void *___tls_get_addr(tls_index *ti) __attribute__((__regparm__(1))) __exported; void *___tls_get_addr(tls_index *ti) __attribute__((__regparm__(1))) __exported;
void *__tls_get_addr(tls_index *ti) __exported; void *__tls_get_addr(tls_index *ti) __exported;
#define RTLD_DEFAULT_STACK_PF_EXEC PF_X
#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC
#define md_abi_variant_hook(x) #define md_abi_variant_hook(x)
size_t calculate_first_tls_offset(size_t size, size_t align, size_t offset); size_t calculate_first_tls_offset(size_t size, size_t align, size_t offset);

View File

@ -122,7 +122,7 @@ map_object(int fd, const char *path, const struct stat *sb)
note_map = NULL; note_map = NULL;
note_map_len = 0; note_map_len = 0;
segs = alloca(sizeof(segs[0]) * hdr->e_phnum); segs = alloca(sizeof(segs[0]) * hdr->e_phnum);
stack_flags = RTLD_DEFAULT_STACK_PF_EXEC | PF_R | PF_W; stack_flags = PF_X | PF_R | PF_W;
text_end = 0; text_end = 0;
while (phdr < phlimit) { while (phdr < phlimit) {
switch (phdr->p_type) { switch (phdr->p_type) {

View File

@ -89,9 +89,6 @@ typedef struct {
extern void *__tls_get_addr(tls_index* ti); extern void *__tls_get_addr(tls_index* ti);
#define RTLD_DEFAULT_STACK_PF_EXEC PF_X
#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC
extern void powerpc_abi_variant_hook(Elf_Auxinfo **); extern void powerpc_abi_variant_hook(Elf_Auxinfo **);
#define md_abi_variant_hook(x) powerpc_abi_variant_hook(x) #define md_abi_variant_hook(x) powerpc_abi_variant_hook(x)

View File

@ -81,9 +81,6 @@ typedef struct {
extern void *__tls_get_addr(tls_index* ti); extern void *__tls_get_addr(tls_index* ti);
#define RTLD_DEFAULT_STACK_PF_EXEC PF_X
#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC
extern void powerpc64_abi_variant_hook(Elf_Auxinfo **); extern void powerpc64_abi_variant_hook(Elf_Auxinfo **);
#define md_abi_variant_hook(x) powerpc64_abi_variant_hook(x) #define md_abi_variant_hook(x) powerpc64_abi_variant_hook(x)

View File

@ -99,9 +99,6 @@ typedef struct {
extern void *__tls_get_addr(tls_index* ti); extern void *__tls_get_addr(tls_index* ti);
#define RTLD_DEFAULT_STACK_PF_EXEC PF_X
#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC
#define md_abi_variant_hook(x) #define md_abi_variant_hook(x)
#endif #endif

View File

@ -269,7 +269,7 @@ static int osreldate;
size_t *pagesizes; size_t *pagesizes;
size_t page_size; size_t page_size;
static int stack_prot = PROT_READ | PROT_WRITE | RTLD_DEFAULT_STACK_EXEC; static int stack_prot = PROT_READ | PROT_WRITE | PROT_EXEC;
static int max_stack_flags; static int max_stack_flags;
/* /*