My original binutils patches for MIPS prelink support were against 2.17, and reserved room for a program header without actually creating one. The mainline (now 2.18) binutils patches ended up adding a PT_NULL header instead. This was needed because of mainline's SIZEOF_HEADER relaxation and was probably a better idea anyway. The patch below therefore teaches the prelinker to remove a PT_NULL header if it needs to find room for a PT_LOAD header. Tested on the MIPS port, where it allows a sysroot built with the mainline binutils to be fully prelinked. Also tested on x86. The patch involves a lot of reidentation, so for reference, I've attached two versions: first the real patch, then the -b form. Richard 200x-xx-xx Richard Sandiford * src/space.c (find_readonly_space): If a new PT_LOAD header is needed, first try removing a PT_NULL header.