aboutsummaryrefslogtreecommitdiff
path: root/gdb/exec.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-01-14 21:01:25 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-01-14 21:01:25 +0000
commit51bee8e9b74abe4f87f96d3ec97e98d34426aae7 (patch)
tree5fba55e3ff29a4b38494053a71ac473c4fbead03 /gdb/exec.c
parentb8040f198caee93044ccfc5aacaa0c3244057b0a (diff)
downloadgdb-51bee8e9b74abe4f87f96d3ec97e98d34426aae7.zip
gdb-51bee8e9b74abe4f87f96d3ec97e98d34426aae7.tar.gz
gdb-51bee8e9b74abe4f87f96d3ec97e98d34426aae7.tar.bz2
gdb/
Support PIEs with no symfile_objfile. * exec.c (print_section_info <abfd == exec_bfd>): Relocate Entry point. * solib-svr4.c (svr4_relocate_main_executable <exec_bfd>): New block. gdb/testsuite/ Support PIEs with no symfile_objfile. * gdb.base/break-interp.exp: New argument at the test_ld calls. (test_ld): New parameter trynosym. (test_ld <$trynosym>): New block.
Diffstat (limited to 'gdb/exec.c')
-rw-r--r--gdb/exec.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/gdb/exec.c b/gdb/exec.c
index 948a1ec..14ee327 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -674,8 +674,36 @@ print_section_info (struct target_section_table *t, bfd *abfd)
wrap_here (" ");
printf_filtered (_("file type %s.\n"), bfd_get_target (abfd));
if (abfd == exec_bfd)
- printf_filtered (_("\tEntry point: %s\n"),
- paddress (gdbarch, bfd_get_start_address (abfd)));
+ {
+ bfd_vma displacement;
+
+ for (p = t->sections; p < t->sections_end; p++)
+ {
+ asection *asect = p->the_bfd_section;
+
+ if ((bfd_get_section_flags (abfd, asect) & (SEC_ALLOC | SEC_LOAD))
+ != (SEC_ALLOC | SEC_LOAD))
+ continue;
+
+ if (bfd_get_section_vma (abfd, asect) <= abfd->start_address
+ && abfd->start_address < (bfd_get_section_vma (abfd, asect)
+ + bfd_get_section_size (asect)))
+ {
+ displacement = p->addr - bfd_get_section_vma (abfd, asect);
+ break;
+ }
+ }
+ if (p == t->sections_end)
+ {
+ warning (_("Cannot find section for the entry point of %s.\n"),
+ bfd_get_filename (abfd));
+ displacement = 0;
+ }
+
+ printf_filtered (_("\tEntry point: %s\n"),
+ paddress (gdbarch, (bfd_get_start_address (abfd)
+ + displacement)));
+ }
for (p = t->sections; p < t->sections_end; p++)
{
printf_filtered ("\t%s", hex_string_custom (p->addr, wid));