aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-07-20 19:51:18 +0000
committerIan Lance Taylor <ian@airs.com>1994-07-20 19:51:18 +0000
commitf9779aad5a94322128a0572b28bb45da7b29acf3 (patch)
tree84ee7b2eae324f8be1a553323ab834a97874443c /bfd/elfcode.h
parentfafc71bab73f4f60d3b3b108817c7cd9aed2f360 (diff)
downloadgdb-f9779aad5a94322128a0572b28bb45da7b29acf3.zip
gdb-f9779aad5a94322128a0572b28bb45da7b29acf3.tar.gz
gdb-f9779aad5a94322128a0572b28bb45da7b29acf3.tar.bz2
* elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add rpath
argument. If it is not NULL, use it to set DT_RPATH. * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype. (bfd_elf64_size_dynamic_sections): Likewise. * bfd-in2.h: Rebuilt.
Diffstat (limited to 'bfd/elfcode.h')
-rw-r--r--bfd/elfcode.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 31452c8..e34951c 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -2887,6 +2887,12 @@ elf_get_dynamic_symtab_upper_bound (abfd)
long symtab_size;
Elf_Internal_Shdr *hdr = &elf_tdata (abfd)->dynsymtab_hdr;
+ if (elf_dynsymtab (abfd) == 0)
+ {
+ bfd_set_error (bfd_error_invalid_operation);
+ return -1;
+ }
+
symcount = hdr->sh_size / sizeof (Elf_External_Sym);
symtab_size = (symcount - 1 + 1) * (sizeof (asymbol *));
@@ -4657,8 +4663,9 @@ static const size_t elf_buckets[] =
addresses of the various sections. */
boolean
-NAME(bfd_elf,size_dynamic_sections) (output_bfd, info, sinterpptr)
+NAME(bfd_elf,size_dynamic_sections) (output_bfd, rpath, info, sinterpptr)
bfd *output_bfd;
+ const char *rpath;
struct bfd_link_info *info;
asection **sinterpptr;
{
@@ -4732,6 +4739,16 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, info, sinterpptr)
elf_hash_table (info)->bucketcount = bucketcount;
+ if (rpath != NULL)
+ {
+ unsigned long indx;
+
+ indx = bfd_add_to_strtab (dynobj, elf_hash_table (info)->dynstr, rpath);
+ if (indx == (unsigned long) -1
+ || ! elf_add_dynamic_entry (info, DT_RPATH, indx))
+ return false;
+ }
+
s = bfd_get_section_by_name (dynobj, ".dynstr");
BFD_ASSERT (s != NULL);
s->_raw_size = elf_hash_table (info)->dynstr->length;