From: visa Date: Tue, 12 Oct 2021 14:06:04 +0000 (+0000) Subject: Do not extend PT_DYNAMIC segment on mips64 X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=692ae43616f1679e94f03e20144803a37d710aea;p=openbsd 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@ --- 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[] =