aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-hppa.h
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2002-06-16 15:32:08 +0000
committerJeff Law <law@redhat.com>2002-06-16 15:32:08 +0000
commitd663e1cd53f5eed52f1680ae30d7dae3e27ce88e (patch)
tree9a468516a7f1f1582112e5f04535a9ed7833dd0d /bfd/elf-hppa.h
parent82b47e62fc24d62eac68b49a46a4bff63a4f03a1 (diff)
downloadgdb-d663e1cd53f5eed52f1680ae30d7dae3e27ce88e.zip
gdb-d663e1cd53f5eed52f1680ae30d7dae3e27ce88e.tar.gz
gdb-d663e1cd53f5eed52f1680ae30d7dae3e27ce88e.tar.bz2
* elf-hppa.h (elf_hppa_final_link): Fix formatting in comment.
Skip excluded sections in determing __gp value. (elf_hppa_final_link_relocate): Use the symbol's address in R_PARISC_FPTR64 relocations that don't need an opd entry. * elf64-hppa.c (allocate_dynrel_entries): Simplify code. (elf64_hppa_finalize_dynreloc): Likewise. (elf64_hppa_size_dynamic_sections): Move comments and fix typo. (elf64_hppa_finish_dynamic_symbol): Break up assert.
Diffstat (limited to 'bfd/elf-hppa.h')
-rw-r--r--bfd/elf-hppa.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h
index 99a66f4..d5a3d15 100644
--- a/bfd/elf-hppa.h
+++ b/bfd/elf-hppa.h
@@ -1296,22 +1296,22 @@ elf_hppa_final_link (abfd, info)
address of the .plt + gp_offset.
If no .plt is found, then look for .dlt, .opd and .data (in
- that order) and set __gp to the base address of whichever section
- is found first. */
+ that order) and set __gp to the base address of whichever
+ section is found first. */
sec = hppa_info->plt_sec;
- if (sec)
+ if (sec && ! (sec->flags & SEC_EXCLUDE))
gp_val = (sec->output_offset
+ sec->output_section->vma
+ hppa_info->gp_offset);
else
{
sec = hppa_info->dlt_sec;
- if (!sec)
+ if (!sec || (sec->flags & SEC_EXCLUDE))
sec = hppa_info->opd_sec;
- if (!sec)
+ if (!sec || (sec->flags & SEC_EXCLUDE))
sec = bfd_get_section_by_name (abfd, ".data");
- if (!sec)
+ if (!sec || (sec->flags & SEC_EXCLUDE))
return false;
gp_val = sec->output_offset + sec->output_section->vma;
@@ -2074,11 +2074,14 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
hppa_info->opd_sec->contents + dyn_h->opd_offset + 24);
}
- /* We want the value of the OPD offset for this symbol, not
- the symbol's actual address. */
- value = (dyn_h->opd_offset
- + hppa_info->opd_sec->output_offset
- + hppa_info->opd_sec->output_section->vma);
+ if (dyn_h->want_opd)
+ /* We want the value of the OPD offset for this symbol. */
+ value = (dyn_h->opd_offset
+ + hppa_info->opd_sec->output_offset
+ + hppa_info->opd_sec->output_section->vma);
+ else
+ /* We want the address of the symbol. */
+ value += addend;
bfd_put_64 (input_bfd, value, hit_data);
return bfd_reloc_ok;