summaryrefslogtreecommitdiff
path: root/bfd/elfxx-ia64.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@tuliptree.org>2003-11-19 01:06:10 +0000
committerJim Wilson <wilson@tuliptree.org>2003-11-19 01:06:10 +0000
commit858d87315ce175b803cd6a1e61355b828cd30559 (patch)
tree83dabd12b5269229c2ae9c4e654d40b87ab88768 /bfd/elfxx-ia64.c
parent932ad5149d17751bc29d4d4b3cd9896d62e83526 (diff)
downloadgdb-858d87315ce175b803cd6a1e61355b828cd30559.tar.gz
Fix -pie core dump with .rela.opd section.
bfd/ChangeLog * elfxx-ia64.c (get_fptr): For fptr_rel, use dynobj not abfd. (elfNN_ia64_size_dynamic_sections): When stripping sections, check for ia64_info->rel_fptr_sec. ld/ChangeLog * emulparams/elf64_ia64.sh (OTHER_PLT_RELOC_SECTIONS): Include .rela.opd if -pie.
Diffstat (limited to 'bfd/elfxx-ia64.c')
-rw-r--r--bfd/elfxx-ia64.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index db4b8aca150..5ff5740515b 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -1993,9 +1993,9 @@ get_fptr (abfd, info, ia64_info)
if (info->pie)
{
asection *fptr_rel;
- fptr_rel = bfd_make_section(abfd, ".rela.opd");
+ fptr_rel = bfd_make_section(dynobj, ".rela.opd");
if (fptr_rel == NULL
- || !bfd_set_section_flags (abfd, fptr_rel,
+ || !bfd_set_section_flags (dynobj, fptr_rel,
(SEC_ALLOC | SEC_LOAD
| SEC_HAS_CONTENTS
| SEC_IN_MEMORY
@@ -2928,6 +2928,15 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info)
if (strip)
ia64_info->fptr_sec = NULL;
}
+ else if (sec == ia64_info->rel_fptr_sec)
+ {
+ if (strip)
+ ia64_info->rel_fptr_sec = NULL;
+ else
+ /* We use the reloc_count field as a counter if we need to
+ copy relocs into the output file. */
+ sec->reloc_count = 0;
+ }
else if (sec == ia64_info->plt_sec)
{
if (strip)