- * the LOAD segment we are in. There is no other way. */
- if (phdr_maxsz < (me->ehdr.e_phnum + 1) * me->ehdr.e_phentsize) {
+ * the LOAD segment we are in. There is no other way.
+ * Also, we can only expand if it is the first LOAD PHDR. */
+ elfu_mPhdrLoadLowestHighest(me, &lowestAddr, &highestAddr,
+ &lowestOffs, &highestOffsEnd);
+ if (phdr_maxsz < (me->ehdr.e_phnum + 1) * me->ehdr.e_phentsize
+ && phdrmp == lowestAddr
+ && phdrmp == lowestOffs) {