This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ELF section in segment
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: amodra at bigpond dot net dot au (Alan Modra)
- Cc: binutils at sourceware dot org, gdb-patches at sourceware dot org
- Date: Sun, 6 May 2007 21:03:00 +0200 (CEST)
- Subject: 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