mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 01:07:52 +00:00
* elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add soname
argument, and use it to set DT_SONAME dynamic entry. * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype. (bfd_elf64_size_dynamic_sections): Update prototype. * bfd-in2.h: Rebuilt.
This commit is contained in:
@@ -1211,16 +1211,18 @@ elf_fake_sections (abfd, asect, ignore)
|
||||
this_hdr->sh_type = SHT_DYNAMIC;
|
||||
this_hdr->sh_entsize = sizeof (Elf_External_Dyn);
|
||||
}
|
||||
else if (strncmp (asect->name, ".rel.", 5) == 0)
|
||||
{
|
||||
this_hdr->sh_type = SHT_REL;
|
||||
this_hdr->sh_entsize = sizeof (Elf_External_Rel);
|
||||
}
|
||||
else if (strncmp (asect->name, ".rela.", 6) == 0)
|
||||
else if (strncmp (asect->name, ".rela", 5) == 0
|
||||
&& get_elf_backend_data (abfd)->use_rela_p)
|
||||
{
|
||||
this_hdr->sh_type = SHT_RELA;
|
||||
this_hdr->sh_entsize = sizeof (Elf_External_Rela);
|
||||
}
|
||||
else if (strncmp (asect->name, ".rel", 4) == 0
|
||||
&& ! get_elf_backend_data (abfd)->use_rela_p)
|
||||
{
|
||||
this_hdr->sh_type = SHT_REL;
|
||||
this_hdr->sh_entsize = sizeof (Elf_External_Rel);
|
||||
}
|
||||
else if (strcmp (asect->name, ".note") == 0)
|
||||
this_hdr->sh_type = SHT_NOTE;
|
||||
else if (strncmp (asect->name, ".stab", 5) == 0
|
||||
@@ -4857,8 +4859,10 @@ static const size_t elf_buckets[] =
|
||||
addresses of the various sections. */
|
||||
|
||||
boolean
|
||||
NAME(bfd_elf,size_dynamic_sections) (output_bfd, rpath, info, sinterpptr)
|
||||
NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, info,
|
||||
sinterpptr)
|
||||
bfd *output_bfd;
|
||||
const char *soname;
|
||||
const char *rpath;
|
||||
struct bfd_link_info *info;
|
||||
asection **sinterpptr;
|
||||
@@ -4933,6 +4937,16 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, rpath, info, sinterpptr)
|
||||
|
||||
elf_hash_table (info)->bucketcount = bucketcount;
|
||||
|
||||
if (soname != NULL)
|
||||
{
|
||||
unsigned long indx;
|
||||
|
||||
indx = bfd_add_to_strtab (dynobj, elf_hash_table (info)->dynstr, soname);
|
||||
if (indx == (unsigned long) -1
|
||||
|| ! elf_add_dynamic_entry (info, DT_SONAME, indx))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (rpath != NULL)
|
||||
{
|
||||
unsigned long indx;
|
||||
|
||||
Reference in New Issue
Block a user