aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-08-30 16:04:40 +0000
committerIan Lance Taylor <ian@airs.com>1994-08-30 16:04:40 +0000
commit0822b56d6697291674d9b15a2ca22f58c8deb2df (patch)
treed69b0c2165d272e35a0e1cffb1b2bfbfd11d1c9e /bfd/elfcode.h
parent3b21918aa62d47f1937f1d6488872097203428b4 (diff)
downloadgdb-0822b56d6697291674d9b15a2ca22f58c8deb2df.zip
gdb-0822b56d6697291674d9b15a2ca22f58c8deb2df.tar.gz
gdb-0822b56d6697291674d9b15a2ca22f58c8deb2df.tar.bz2
* 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.
Diffstat (limited to 'bfd/elfcode.h')
-rw-r--r--bfd/elfcode.h28
1 files changed, 21 insertions, 7 deletions
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 5a2ef54..78ae323 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -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;