summaryrefslogtreecommitdiff
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
commitd8efd39eccba2f851a9f3b87ada5141647a2138d (patch)
treebca88345d622e9baddbdee5b87a178025914d965 /bfd/elf-hppa.h
parent965afb4550efcf1113f91b7b8fa792b17fe51ca8 (diff)
downloadgdb-d8efd39eccba2f851a9f3b87ada5141647a2138d.tar.gz
* 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 99a66f4e180..d5a3d15d4e7 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;