aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2013-05-10 12:55:13 +0000
committerJoel Brobecker <brobecker@gnat.com>2013-05-10 12:55:13 +0000
commit060cfbef397769f935df461cb90d237c0783045a (patch)
tree5ab48c1d911d6f8b2c3f29e99c331d743cae4471 /gdb
parentc1357578b3f2cd7c151f74bde1d3751c32e50966 (diff)
downloadgdb-060cfbef397769f935df461cb90d237c0783045a.zip
gdb-060cfbef397769f935df461cb90d237c0783045a.tar.gz
gdb-060cfbef397769f935df461cb90d237c0783045a.tar.bz2
AIX: wrong address for shared object's .bss section
gdb/ChangeLog: * solib-aix.c (solib_aix_relocate_section_addresses): For the .bss section action, apply the same offset as the .data section.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/solib-aix.c16
2 files changed, 21 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7ee965a..9f7b972 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2013-05-10 Joel Brobecker <brobecker@adacore.com>
+ * solib-aix.c (solib_aix_relocate_section_addresses):
+ For the .bss section action, apply the same offset as
+ the .data section.
+
+2013-05-10 Joel Brobecker <brobecker@adacore.com>
+
PR tdep/15420:
* sol-thread.c (ps_lgetxregsize, ps_lgetxregs, ps_lsetxregs):
New functions, directly copied from sparc-sol-thread.c.
diff --git a/gdb/solib-aix.c b/gdb/solib-aix.c
index 9fa5de9..4672b58 100644
--- a/gdb/solib-aix.c
+++ b/gdb/solib-aix.c
@@ -411,7 +411,21 @@ solib_aix_relocate_section_addresses (struct so_list *so,
}
else if (strcmp (section_name, ".bss") == 0)
{
- sec->addr = bfd_section_vma (abfd, bfd_sect) + info->data_addr;
+ /* The information provided by the loader does not include
+ the address of the .bss section, but we know that it gets
+ relocated by the same offset as the .data section. So,
+ compute the relocation offset for the .data section, and
+ apply it to the .bss section as well. If the .data section
+ is not defined (which seems highly unlikely), do our best
+ by assuming no relocation. */
+ struct bfd_section *data_sect
+ = bfd_get_section_by_name (abfd, ".data");
+ CORE_ADDR data_offset = 0;
+
+ if (data_sect != NULL)
+ data_offset = info->data_addr - bfd_section_vma (abfd, data_sect);
+
+ sec->addr = bfd_section_vma (abfd, bfd_sect) + data_offset;
sec->addr += solib_aix_bss_data_overlap (abfd);
sec->endaddr = sec->addr + bfd_section_size (abfd, bfd_sect);
}