after switching from 2.17.50.0.12 to 2.17.50.0.17 i'm observing assertion failures during stripping native solaris libs. $ sparc-sun-solaris2.9-strip libFS.so.5 BFD: BFD (Linux/GNU Binutils) 2.17.50.0.17.20070615 assertion fail elf.c:6234 BFD: st53IDU9: section `.data1' can't be allocated in segment 0 sparc-sun-solaris2.9-strip: st53IDU9: Bad value BFD: st53IDU9: section `.data1' can't be allocated in segment 0 sparc-sun-solaris2.9-strip: st53IDU9: Bad value $ sparc-sun-solaris2.9-strip libX11.so.4 BFD: BFD (Linux/GNU Binutils) 2.17.50.0.17.20070615 assertion fail elf.c:6234 BFD: stz6mGpK: section `.bss' can't be allocated in segment 0 sparc-sun-solaris2.9-strip: stz6mGpK: Bad value BFD: stz6mGpK: section `.bss' can't be allocated in segment 0 sparc-sun-solaris2.9-strip: stz6mGpK: Bad value
Created attachment 1904 [details] testcase #1
Created attachment 1905 [details] testcase #2
native solaris stripper works fine. $ strip -V strip: Software Generation Utilities (SGU) Solaris-ELF (4.0) $ uname -a SunOS hermes 5.9 Generic_117171-07 sun4u sparc SUNW,Sun-Blade-1500
Neither of the attached files have correct program headers. For libFS.so, Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x000000 0x00000000 0x00000000 0x07dbf 0x07dbf R E 0x4 LOAD 0x0080b4 0x00000000 0x00000000 0x18b5d 0x18b5d RWE 0x2000 DYNAMIC 0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4 LOOS+ffffffb 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x4 Notice how both load segments have p_vaddr of zero. Strictly speaking, this means they overlap. Obviously the sun loader ignores the addresses..
I think http://sourceware.org/ml/binutils/2006-12/msg00165.html should also be adjusting lma. Index: bfd/elf.c =================================================================== RCS file: /cvs/src/src/bfd/elf.c,v retrieving revision 1.394 diff -u -p -r1.394 elf.c --- bfd/elf.c 29 Jun 2007 16:29:15 -0000 1.394 +++ bfd/elf.c 1 Jul 2007 05:08:52 -0000 @@ -4373,7 +4373,7 @@ assign_file_positions_for_load_sections else if (m->count == 0) p->p_paddr = 0; else - p->p_paddr = m->sections[0]->lma; + p->p_paddr = m->sections[0]->lma - m->p_vaddr_offset; if (p->p_type == PT_LOAD && (abfd->flags & D_PAGED) != 0) At least, doing so allows strip to process these funky files.
http://sourceware.org/ml/binutils-cvs/2007-07/msg00005.html