diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 00afa81398d..981e0cd4e92 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2019-08-23 Stafford Horne + + * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Use correct value for + PLT GOT entries. + 2019-08-23 Nick Clifton PR 24456 diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c index c2069a3180e..0d1336ceacc 100644 --- a/bfd/elf32-or1k.c +++ b/bfd/elf32-or1k.c @@ -2377,8 +2377,11 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd, or1k_write_plt_entry (output_bfd, splt->contents + h->plt.offset, plt0, plt1, plt2, OR1K_JR(12)); - /* Fill in the entry in the global offset table. */ - bfd_put_32 (output_bfd, plt_addr, sgot->contents + got_offset); + /* Fill in the entry in the global offset table. We initialize it to + point to the top of the plt. This is done to lazy lookup the actual + symbol as the first plt entry will be setup by libc to call the + runtime dynamic linker. */ + bfd_put_32 (output_bfd, plt_base_addr, sgot->contents + got_offset); /* Fill in the entry in the .rela.plt section. */ rela.r_offset = got_addr;