summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2021-10-12 14:06:05 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2021-10-12 14:06:05 +0000
commit2d9b2a2b532ceb7fad373e0056619a988ce21582 (patch)
tree3ce93eead8dfd2cc8f63d2b350e0c6de739f07c3
parent611a24f7a47c5c7018c528155de39676f70cda95 (diff)
Do not extend PT_DYNAMIC segment on mips64
The IRIX-specific extension of the PT_DYNAMIC segment is not needed by the dynamic linker on OpenBSD/mips64. Disable it so that the .dynamic section stays at the start of the PT_DYNAMIC segment even when .dynstr, .dynsym or .hash precedes .dynamic in the ELF file. This enables Binutils 2.17 tools, such as strip(1), rewrite executables and shared libraries that have been produced by LLD. OK kettenis@
-rw-r--r--gnu/usr.bin/binutils-2.17/bfd/elfxx-mips.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gnu/usr.bin/binutils-2.17/bfd/elfxx-mips.c b/gnu/usr.bin/binutils-2.17/bfd/elfxx-mips.c
index 708bdada3b3..97d8854871d 100644
--- a/gnu/usr.bin/binutils-2.17/bfd/elfxx-mips.c
+++ b/gnu/usr.bin/binutils-2.17/bfd/elfxx-mips.c
@@ -9325,7 +9325,8 @@ _bfd_mips_elf_modify_segment_map (bfd *abfd,
m->p_flags_valid = 1;
}
}
- if (m != NULL
+ if (SGI_COMPAT (abfd)
+ && m != NULL
&& m->count == 1 && strcmp (m->sections[0]->name, ".dynamic") == 0)
{
static const char *sec_names[] =