This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ELF section in segment


Alan Modra wrote:

> include/elf/
> 	* internal.h (ELF_IS_SECTION_IN_SEGMENT): Check both file offset
> 	and vma for appropriate sections.
> bfd/
> 	* elf.c (assign_file_positions_for_load_sections): Set sh_offset
> 	here.  Set sh_type to SHT_NOBITS if we won't be allocating
> 	file space.  Don't bump p_memsz for non-alloc sections.  Adjust
> 	section-in-segment check.
> 	(assign_file_positions_for_non_load_sections): Don't set sh_offset
> 	here for sections that have already been handled above.

It looks like this patch broke GDB's generate-core-file capability:

(gdb) gcore /home/uweigand/fsf/gdb-head-build/gdb/testsuite/gdb.base/gcore.test^M
BFD: /home/uweigand/fsf/gdb-head-build/gdb/testsuite/gdb.base/gcore.test: section `note0' can't be allocated in segment 0^M
warning: Failed to write corefile contents (Bad value).^M
BFD: /home/uweigand/fsf/gdb-head-build/gdb/testsuite/gdb.base/gcore.test: section `note0' can't be allocated in segment 0^M
warning: Failed to write corefile contents (Bad value).^M
BFD: /home/uweigand/fsf/gdb-head-build/gdb/testsuite/gdb.base/gcore.test: section `note0' can't be allocated in segment 0^M
warning: Failed to write corefile contents (Bad value).^M
BFD: /home/uweigand/fsf/gdb-head-build/gdb/testsuite/gdb.base/gcore.test: section `note0' can't be allocated in segment 0^M
warning: Failed to write corefile contents (Bad value).^M
BFD: /home/uweigand/fsf/gdb-head-build/gdb/testsuite/gdb.base/gcore.test: section `note0' can't be allocated in segment 0^M
warning: Failed to write corefile contents (Bad value).^M
BFD: /home/uweigand/fsf/gdb-head-build/gdb/testsuite/gdb.base/gcore.test: section `note0' can't be allocated in segment 0^M
warning: Failed to write corefile contents (Bad value).^M
BFD: /home/uweigand/fsf/gdb-head-build/gdb/testsuite/gdb.base/gcore.test: section `note0' can't be allocated in segment 0^M
warning: Failed to write corefile contents (Bad value).^M
BFD: /home/uweigand/fsf/gdb-head-build/gdb/testsuite/gdb.base/gcore.test: section `note0' can't be allocated in segment 0^M
warning: Failed to write corefile contents (Bad value).^M
BFD: /home/uweigand/fsf/gdb-head-build/gdb/testsuite/gdb.base/gcore.test: section `note0' can't be allocated in segment 0^M
warning: Failed to write corefile contents (Bad value).^M
BFD: /home/uweigand/fsf/gdb-head-build/gdb/testsuite/gdb.base/gcore.test: section `note0' can't be allocated in segment 0^M
warning: Failed to write corefile contents (Bad value).^M
BFD: /home/uweigand/fsf/gdb-head-build/gdb/testsuite/gdb.base/gcore.test: section `note0' can't be allocated in segment 0^M
warning: writing note section (Bad value)^M
Saved corefile /home/uweigand/fsf/gdb-head-build/gdb/testsuite/gdb.base/gcore.test^M

Reverting the patch makes the error go away ...

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]