+2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/21389
+ * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
+ before generating the version definition section.
+
2017-04-17 Alan Modra <amodra@gmail.com>
* elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
struct bfd_link_info *info,
asection **sinterpptr)
{
- size_t soname_indx;
bfd *dynobj;
const struct elf_backend_data *bed;
*sinterpptr = NULL;
- soname_indx = (size_t) -1;
-
if (!is_elf_hash_table (info->hash))
return TRUE;
struct elf_info_failed eif;
bfd_boolean all_defined;
asection *s;
+ size_t soname_indx;
eif.info = info;
eif.failed = FALSE;
return FALSE;
}
+ if (soname != NULL)
+ {
+ soname_indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr,
+ soname, TRUE);
+ if (soname_indx == (size_t) -1
+ || !_bfd_elf_add_dynamic_entry (info, DT_SONAME, soname_indx))
+ return FALSE;
+ }
+ else
+ soname_indx = (size_t) -1;
+
/* Make all global versions with definition. */
for (t = info->version_info; t != NULL; t = t->next)
for (d = t->globals.list; d != NULL; d = d->next)
*sinterpptr = bfd_get_linker_section (dynobj, ".interp");
BFD_ASSERT (*sinterpptr != NULL || !bfd_link_executable (info) || info->nointerp);
- if (soname != NULL)
- {
- soname_indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr,
- soname, TRUE);
- if (soname_indx == (size_t) -1
- || !_bfd_elf_add_dynamic_entry (info, DT_SONAME, soname_indx))
- return FALSE;
- }
-
if (info->symbolic)
{
if (!_bfd_elf_add_dynamic_entry (info, DT_SYMBOLIC, 0))
+2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/21389
+ * testsuite/ld-elf/pr21389.map: New file.
+ * testsuite/ld-elf/pr21389.s: Likewise.
+ * testsuite/ld-elf/pr21389a.d: Likewise.
+ * testsuite/ld-elf/pr21389b.d: Likewise.
+ * testsuite/ld-elf/pr21389c.d: Likewise.
+
2017-04-17 Alan Modra <amodra@gmail.com>
* testsuite/ld-elf/indirect5a.c,