aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authormengqinggang <mengqinggang@loongson.cn>2024-04-03 10:20:27 +0800
committerliuzhensong <liuzhensong@loongson.cn>2024-04-09 14:31:04 +0800
commit2bf280a827577eaf26d657af9f5e29dbf77e6ee2 (patch)
tree4aed8bc14fe1f925b7bdb02ed1ef4262f5fbe928 /bfd
parentedb30f5782826af431e26aac4362cca687e77913 (diff)
downloadgdb-2bf280a827577eaf26d657af9f5e29dbf77e6ee2.zip
gdb-2bf280a827577eaf26d657af9f5e29dbf77e6ee2.tar.gz
gdb-2bf280a827577eaf26d657af9f5e29dbf77e6ee2.tar.bz2
LoongArch: ld: Move .got .got.plt before .data and protect .got with relro
Move .got .got.plt before .data so .got can be protected with -zrelro. And the first two entries of .got.plt (_dl_runtime_resolve and link map) are placed within the relro region.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/elfnn-loongarch.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c
index eb70799..e863290 100644
--- a/bfd/elfnn-loongarch.c
+++ b/bfd/elfnn-loongarch.c
@@ -127,6 +127,8 @@ struct loongarch_elf_link_hash_table
#define GOT_ENTRY_SIZE (LARCH_ELF_WORD_BYTES)
+/* Reserve two entries of GOTPLT for ld.so, one is used for PLT
+ resolver _dl_runtime_resolve, the other is used for link map. */
#define GOTPLT_HEADER_SIZE (GOT_ENTRY_SIZE * 2)
#define elf_backend_want_got_plt 1