aboutsummaryrefslogtreecommitdiff
path: root/gdb/elfread.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2009-11-02 17:16:14 +0000
committerDaniel Jacobowitz <drow@false.org>2009-11-02 17:16:14 +0000
commitad09a548819bfa35c8fbf7f69ba1c5d154b82801 (patch)
tree47d09bf6d63ebe3e6543a2507c2f21c55ae392dd /gdb/elfread.c
parentbcf71277606f177627b97d050cf45aa74e799b1c (diff)
downloadgdb-ad09a548819bfa35c8fbf7f69ba1c5d154b82801.zip
gdb-ad09a548819bfa35c8fbf7f69ba1c5d154b82801.tar.gz
gdb-ad09a548819bfa35c8fbf7f69ba1c5d154b82801.tar.bz2
* elfread.c (elf_symfile_segments): Do not warn about
uninitialized sections outside of load segments.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r--gdb/elfread.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 767dfe6..131d7d2 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -114,7 +114,17 @@ elf_symfile_segments (bfd *abfd)
break;
}
- if (bfd_get_section_size (sect) > 0 && j == num_segments)
+ /* We should have found a segment for every non-empty section.
+ If we haven't, we will not relocate this section by any
+ offsets we apply to the segments. As an exception, do not
+ warn about SHT_NOBITS sections; in normal ELF execution
+ environments, SHT_NOBITS means zero-initialized and belongs
+ in a segment, but in no-OS environments some tools (e.g. ARM
+ RealView) use SHT_NOBITS for uninitialized data. Since it is
+ uninitialized, it doesn't need a program header. Such
+ binaries are not relocatable. */
+ if (bfd_get_section_size (sect) > 0 && j == num_segments
+ && (bfd_get_section_flags (abfd, sect) & SEC_LOAD) != 0)
warning (_("Loadable segment \"%s\" outside of ELF segments"),
bfd_section_name (abfd, sect));
}