diff options
author | Jeff Law <law@redhat.com> | 1999-09-16 16:51:34 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1999-09-16 16:51:34 +0000 |
commit | dfec422f08f6a55459da38a629502caeb4e2d115 (patch) | |
tree | 13cd5becff76ebf34d793ac81ec35900a179221f /bfd | |
parent | d0f2103d0777c9f7f79fe9eff767438d63a617fa (diff) | |
download | gdb-dfec422f08f6a55459da38a629502caeb4e2d115.zip gdb-dfec422f08f6a55459da38a629502caeb4e2d115.tar.gz gdb-dfec422f08f6a55459da38a629502caeb4e2d115.tar.bz2 |
* elf-hppa.h (elf_hppa_relocate_section): Allow undefined
symbols when building shared libraries.
(elf_hppa_final_link_relocate): Correct handling of PCREL
relocations against undefined symbols.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/elf-hppa.h | 39 |
2 files changed, 38 insertions, 8 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 25a8c4c..15ec069 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +Thu Sep 16 10:48:17 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_relocate_section): Allow undefined + symbols when building shared libraries. + (elf_hppa_final_link_relocate): Correct handling of PCREL + relocations against undefined symbols. + 1999-09-16 Nick Clifton <nickc@cygnus.com> * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Mark diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h index 6486e9d..d0785b6 100644 --- a/bfd/elf-hppa.h +++ b/bfd/elf-hppa.h @@ -1004,7 +1004,6 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section, { sym_sec = h->root.u.def.section; - /* If this symbol has an entry in the PA64 dynamic hash table, then get it. */ dyn_name = get_dyn_name (input_bfd, h, rel, @@ -1032,6 +1031,26 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section, else relocation = 0; } + /* Allow undefined symbols in shared libraries. */ + else if (info->shared && !info->symbolic && !info->no_undefined) + { + /* If this symbol has an entry in the PA64 dynamic hash + table, then get it. */ + dyn_name = get_dyn_name (input_bfd, h, rel, + &dynh_buf, &dynh_buflen); + dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, + dyn_name, false, false); + + if (dyn_h == NULL) + { + (*_bfd_error_handler) + (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"), + bfd_get_filename (input_bfd), h->root.root.string, + bfd_get_section_name (input_bfd, input_section)); + relocation = 0; + } + relocation = 0; + } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; else @@ -1150,8 +1169,9 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, /* If this is a call to a function defined in another dynamic library, then redirect the call to the local stub for this function. */ - if (sym_sec->output_section == NULL) - value = dyn_h->stub_offset; + if (sym_sec == NULL || sym_sec->output_section == NULL) + value = (dyn_h->stub_offset + hppa_info->stub_sec->output_offset + + hppa_info->stub_sec->output_section->vma); /* Turn VALUE into a proper PC relative address. */ value -= (offset + input_section->output_offset @@ -1184,7 +1204,7 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, /* If this is a call to a function defined in another dynamic library, then redirect the call to the local stub for this function. */ - if (sym_sec->output_section == NULL) + if (sym_sec == NULL || sym_sec->output_section == NULL) value = (dyn_h->stub_offset + hppa_info->stub_sec->output_offset + hppa_info->stub_sec->output_section->vma); @@ -1507,8 +1527,9 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, /* If this is a call to a function defined in another dynamic library, then redirect the call to the local stub for this function. */ - if (sym_sec->output_section == NULL) - value = dyn_h->stub_offset; + if (sym_sec == NULL || sym_sec->output_section == NULL) + value = (dyn_h->stub_offset + hppa_info->stub_sec->output_offset + + hppa_info->stub_sec->output_section->vma); /* Turn VALUE into a proper PC relative address. */ value -= (offset + input_section->output_offset @@ -1525,8 +1546,10 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, /* If this is a call to a function defined in another dynamic library, then redirect the call to the local stub for this function. */ - if (sym_sec->output_section == NULL) - value = dyn_h->stub_offset; + if (sym_sec == NULL || sym_sec->output_section == NULL) + value = (dyn_h->stub_offset + hppa_info->stub_sec->output_offset + + hppa_info->stub_sec->output_section->vma); + /* Turn VALUE into a proper PC relative address. */ value -= (offset + input_section->output_offset |