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]

[PATCH] 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.
---
 gdb/dwarf2read.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 496b74f..f498a3a 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;
 }


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