This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] dwarf2read: Allow SEC_ALLOC sections to be located at address 0.
- From: Kevin Buettner <kevinb at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 18 Jul 2015 17:12:17 -0000
- Subject: [binutils-gdb] dwarf2read: Allow SEC_ALLOC sections to be located at address 0.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b4e1fd615ae6582170a6bb62d6519d586bd5347e
commit b4e1fd615ae6582170a6bb62d6519d586bd5347e
Author: Kevin Buettner <kevinb@redhat.com>
Date: Fri Jul 10 17:41:55 2015 -0700
dwarf2read: Allow SEC_ALLOC sections to be located at address 0.
GDB already allows statically initialized variables, located in
SEC_LOAD sections, to be placed at address 0. This change allows
uninitialized variables (which are in SEC_ALLOC sections) to be placed
address 0 as well.
gdb/ChangeLog:
* dwarf2read.c (dwarf2_locate_sections): Allow has_section_at_zero
to be set for SEC_ALLOC sections too.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/dwarf2read.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 3bd64ab..7f31ff5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2015-07-18 Kevin Buettner <kevinb@redhat.com>
+
+ * dwarf2read.c (dwarf2_locate_sections): Allow has_section_at_zero
+ to be set for SEC_ALLOC sections too.
+
2015-07-17 Yao Qi <yao.qi@linaro.org>
* Makefile.in (HFILES_NO_SRCDIR): Add
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 91c6a8f..f440956 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -2241,7 +2241,7 @@ dwarf2_locate_sections (bfd *abfd, asection *sectp, void *vnames)
dwarf2_per_objfile->gdb_index.size = bfd_get_section_size (sectp);
}
- if ((bfd_get_section_flags (abfd, sectp) & SEC_LOAD)
+ if ((bfd_get_section_flags (abfd, sectp) & (SEC_LOAD | SEC_ALLOC))
&& bfd_section_vma (abfd, sectp) == 0)
dwarf2_per_objfile->has_section_at_zero = 1;
}