diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-02-15 17:37:35 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-02-15 17:37:35 +0000 |
commit | 4e1fc9c9718fef23508d3a7c6349bbfe4e9b0f3c (patch) | |
tree | 79099dfcdd787b0690fca694db134a5549c1631d /gdb/solib-svr4.c | |
parent | 74164c5624c276e97cf9cb01876ef908745cd185 (diff) | |
download | gdb-4e1fc9c9718fef23508d3a7c6349bbfe4e9b0f3c.zip gdb-4e1fc9c9718fef23508d3a7c6349bbfe4e9b0f3c.tar.gz gdb-4e1fc9c9718fef23508d3a7c6349bbfe4e9b0f3c.tar.bz2 |
gdb/
* solib-svr4.c (LM_ADDR_CHECK): New variable minpagesize. Optionally
initialize it from ELF BFD. Extend the prelink condition by it.
Diffstat (limited to 'gdb/solib-svr4.c')
-rw-r--r-- | gdb/solib-svr4.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index ae3f49a..f8e8e84 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -194,6 +194,7 @@ LM_ADDR_CHECK (struct so_list *so, bfd *abfd) if (dynaddr + l_addr != l_dynaddr) { CORE_ADDR align = 0x1000; + CORE_ADDR minpagesize = align; if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) { @@ -206,6 +207,8 @@ LM_ADDR_CHECK (struct so_list *so, bfd *abfd) for (i = 0; i < ehdr->e_phnum; i++) if (phdr[i].p_type == PT_LOAD && phdr[i].p_align > align) align = phdr[i].p_align; + + minpagesize = get_elf_backend_data (abfd)->minpagesize; } /* Turn it into a mask. */ @@ -230,9 +233,12 @@ LM_ADDR_CHECK (struct so_list *so, bfd *abfd) mapping of the library may not actually happen on a 64k boundary! (In the usual case where (l_addr & align) == 0, this check is - equivalent to the possibly expected check above.) */ + equivalent to the possibly expected check above.) + + Even on PPC it must be zero-aligned at least for MINPAGESIZE. */ - if ((l_addr & align) == ((l_dynaddr - dynaddr) & align)) + if ((l_addr & (minpagesize - 1)) == 0 + && (l_addr & align) == ((l_dynaddr - dynaddr) & align)) { l_addr = l_dynaddr - dynaddr; |