On Sat, 28 Jul 2007 22:16:04 +0200, Roland McGrath wrote: > Are you sure that changing _bfd_elf_make_section_from_phdr is the right way > to fix gdb? > > It is in a certain sense accurate to split the one segment into two > sections, a leading SEC_LOAD one and a trailing one without SEC_LOAD. The core files with `p_filesz == 0' were working before. _bfd_elf_make_section_from_phdr() can create the sections as two parts, with the second problematic one emulating the former `p_filesz == 0' core segments. No new memory structure layout was introduced. [attached] Another issue would be changing the sections layout as currently the original p_memsz is still lost. Going to post later an add-on incompatible change using SEC_NEVER_LOAD so that the p_memsz is retained for the bfd library applications + across objcopy. > What does your change do to e.g. objcopy on a core file? (the previous version was stripping the `load1b' part), thanks for finding it. Best Regards, Jan Patched bfd version with the new `p_filesz == 4096' kernel core file: CVS HEAD gdb `info files': 0x0000000000400000 - 0x0000000000401000 is load1a 0x0000000000401000 - 0x0000000000401000 is load1b 0x00000000006b1000 - 0x00000000006bb000 is load2 objcopy: Section Headers: [Nr] Name Type Addr Off Size ES Flags Lk Inf Al [ 5] load1a PROGBITS 0000000000400000 00001000 00001000 0 AX 0 0 4096 [ 6] load1b PROGBITS 0000000000401000 00002000 00000000 0 AX 0 0 4096 [ 7] load2 PROGBITS 00000000006b1000 00002000 0000a000 0 WA 0 0 4096 Former bfd version with the former `p_filesz == 0' kernel core file: CVS HEAD gdb `info files': 0x0000000000400000 - 0x0000000000400000 is load1 0x00000000006b1000 - 0x00000000006bb000 is load2 objcopy: Section Headers: [ 5] load1 PROGBITS 0000000000400000 00001000 00000000 0 AX 0 0 4096 [ 6] load2 PROGBITS 00000000006b1000 00001000 0000a000 0 WA 0 0 4096