Hi Juho,
If objcopy or strip is applied to an ELF executable which has a LOAD segment in the program header, but none of the sections refer to it, the virtual address of the segment is set to zero. This behavior is incorrect, as the virtual address is not supposed to be used like this according to the ELF standard. If the segment is to be ignored, its type should be set to NULL or the segment should be discarded altogether, but I prefer that the segment should just be preserved as is. This behavior is probably caused by assign_file_positions_for_load_sections in elf.c: if (m->count == 0) p->p_vaddr = 0; else p->p_vaddr = m->sections[0]->vma - m->p_vaddr_offset;
Please could you file a bug report about this problem here: http://sourceware.org/bugzilla/ Including a simple test case to reproduce the problem will really help. Cheers Nick _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils