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.
2011-04-17 Jan Kratochvil <jan.kratochvil@redhat.com>
+ 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.
+
+2011-04-17 Jan Kratochvil <jan.kratochvil@redhat.com>
+
* corelow.c: Include wrapper.h.
(core_open): Call now gdb_target_find_new_threads.
* wrapper.c: Include target.h.
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"),
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:
2011-04-17 Jan Kratochvil <jan.kratochvil@redhat.com>
+ * gdb.base/break-interp-lib.c (v, vptr): New variables.
+ * gdb.base/break-interp.exp (test_attach): New comment.
+
+2011-04-17 Jan Kratochvil <jan.kratochvil@redhat.com>
+
* gdb.threads/gcore-thread.exp ($core0file): New variable.
(clear __stack_user.next, clear stack_used.next)
(save a zeroed-threads corefile): New test.
#include <assert.h>
#include <stdio.h>
+/* Force REL->RELA conversion on i386, see "Prelink", March 4, 2004. */
+volatile int v[2];
+volatile int *vptr = &v[1];
+
void
libfunc (const char *action)
{
# test simplicity, we merged this test and the test above by not
# restoring $INTERP after $EXEC prelink. $INTERP gets restored
# later below.
+ #
+ # `(wrong library or version mismatch?)' messages are printed for
+ # $binfile_lib on platforms converting REL->RELA relocations by
+ # prelink (such as on i386). There is no reliable way to verify
+ # the library file matches the running library in such case but
+ # GDB at least attempts to set the right displacement. We test
+ # `libfunc' is present in the backtrace and therefore the
+ # displacement has been guessed right.
if [prelink$relink $relink_args [file tail $exec]] {
# /proc/PID/exe cannot be loaded as it is "EXECNAME (deleted)".