diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2018-10-25 16:41:39 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2018-10-25 16:41:39 +0000 |
commit | fa62b0aefb2b5fe105e25eb8cdf1b39306df5212 (patch) | |
tree | cf1cbb924a469f8895581c2a532a56ff3d1fef67 /libexec/ld.so/amd64 | |
parent | 216fbb53067c8e910c8fb04d387ca5b45600039a (diff) |
The compilers already put static arrays in .rodata when not written to;
marking them const will keep a source change from silently moving them
back to .data
ok deraadt@ kettenis@
Diffstat (limited to 'libexec/ld.so/amd64')
-rw-r--r-- | libexec/ld.so/amd64/rtld_machine.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libexec/ld.so/amd64/rtld_machine.c b/libexec/ld.so/amd64/rtld_machine.c index 7e6c65ed80b..dd14f4b6b66 100644 --- a/libexec/ld.so/amd64/rtld_machine.c +++ b/libexec/ld.so/amd64/rtld_machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld_machine.c,v 1.28 2017/01/24 07:48:37 guenther Exp $ */ +/* $OpenBSD: rtld_machine.c,v 1.29 2018/10/25 16:41:38 guenther Exp $ */ /* * Copyright (c) 2002,2004 Dale Rahn @@ -101,7 +101,7 @@ int64_t pcookie __attribute__((section(".openbsd.randomdata"))) __dso_hidden; #define _RF_E 0x02000000 /* ERROR */ #define _RF_SZ(s) (((s) & 0xff) << 8) /* memory target size */ #define _RF_RS(s) ((s) & 0xff) /* right shift */ -static int reloc_target_flags[] = { +static const int reloc_target_flags[] = { 0, /* 0 NONE */ _RF_S|_RF_A| _RF_SZ(64) | _RF_RS(0), /* 1 _64*/ _RF_S|_RF_A|_RF_P| _RF_SZ(32) | _RF_RS(0), /* 2 PC32 */ @@ -136,7 +136,7 @@ static int reloc_target_flags[] = { #define RELOC_VALUE_RIGHTSHIFT(t) (reloc_target_flags[t] & 0xff) #define RELOC_ERROR(t) (reloc_target_flags[t] & _RF_E) -static Elf_Addr reloc_target_bitmask[] = { +static const Elf_Addr reloc_target_bitmask[] = { #define _BM(x) (~(Elf_Addr)0 >> ((8*sizeof(reloc_target_bitmask[0])) - (x))) 0, /* 0 NONE */ _BM(64), /* 1 _64*/ |