X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=bfd%2Felf64-x86-64.c;h=f9eb7db643435b315a58eb5a2963544676b7e09f;hb=8c37241be3b1baf394090269b4b67babceb83d61;hp=ee1b14e193fc1d714945c778a4e848df3d84dd0a;hpb=42edda508ef24ada777099d51f200a3b674a1724;p=external%2Fbinutils.git diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index ee1b14e..f9eb7db 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -1911,9 +1911,11 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, if (off >= (bfd_vma) -2) abort (); - relocation = htab->sgot->output_offset + off; - if (r_type == R_X86_64_GOTPCREL) - relocation += htab->sgot->output_section->vma; + relocation = htab->sgot->output_section->vma + + htab->sgot->output_offset + off; + if (r_type != R_X86_64_GOTPCREL) + relocation -= htab->sgotplt->output_section->vma + - htab->sgotplt->output_offset; break; @@ -2664,7 +2666,8 @@ elf64_x86_64_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *inf continue; case DT_PLTGOT: - dyn.d_un.d_ptr = htab->sgot->output_section->vma; + s = htab->sgotplt; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; break; case DT_JMPREL: @@ -2755,6 +2758,10 @@ elf64_x86_64_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *inf GOT_ENTRY_SIZE; } + if (htab->sgot && htab->sgot->_raw_size > 0) + elf_section_data (htab->sgot->output_section)->this_hdr.sh_entsize + = GOT_ENTRY_SIZE; + return TRUE; }