diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-04-17 19:17:10 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-04-17 19:17:10 +0000 |
commit | 0283589814e341df59ca48e497ff6671fbcb5955 (patch) | |
tree | 2d7d4390e6b810a06a1fccb8956ea136fd947512 /gdb/solib-svr4.c | |
parent | 9a845ea22cc25f5346c9d465c9cb206319898bee (diff) | |
download | gdb-0283589814e341df59ca48e497ff6671fbcb5955.zip gdb-0283589814e341df59ca48e497ff6671fbcb5955.tar.gz gdb-0283589814e341df59ca48e497ff6671fbcb5955.tar.bz2 |
gdb/
Fix libraries displacement if they change whether they were prelinked.
* solib-svr4.c (LM_ADDR_CHECK): Set L_ADDR even if the DYNAMIC pointer
does not match. Comment why.
gdb/testsuite/
* gdb.base/break-interp-lib.c (v, vptr): New variables.
* gdb.base/break-interp.exp (test_attach): New comment.
Diffstat (limited to 'gdb/solib-svr4.c')
-rw-r--r-- | gdb/solib-svr4.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 78c6b1c..b632dd0 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -237,11 +237,11 @@ LM_ADDR_CHECK (struct so_list *so, bfd *abfd) Even on PPC it must be zero-aligned at least for MINPAGESIZE. */ + l_addr = l_dynaddr - dynaddr; + if ((l_addr & (minpagesize - 1)) == 0 && (l_addr & align) == ((l_dynaddr - dynaddr) & align)) { - l_addr = l_dynaddr - dynaddr; - if (info_verbose) printf_unfiltered (_("Using PIC (Position Independent Code) " "prelink displacement %s for \"%s\".\n"), @@ -249,9 +249,20 @@ LM_ADDR_CHECK (struct so_list *so, bfd *abfd) so->so_name); } else - warning (_(".dynamic section for \"%s\" " - "is not at the expected address " - "(wrong library or version mismatch?)"), so->so_name); + { + /* There is no way to verify the library file matches. prelink + can during prelinking of an unprelinked file (or unprelinking + of a prelinked file) shift the DYNAMIC segment by arbitrary + offset without any page size alignment. There is no way to + find out the ELF header and/or Program Headers for a limited + verification if it they match. One could do a verification + of the DYNAMIC segment. Still the found address is the best + one GDB could find. */ + + warning (_(".dynamic section for \"%s\" " + "is not at the expected address " + "(wrong library or version mismatch?)"), so->so_name); + } } set_addr: |