diff options
author | Ian Lance Taylor <ian@airs.com> | 1994-06-15 19:58:59 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1994-06-15 19:58:59 +0000 |
commit | 7c726b6625a0310e63a2b046dc3b4a3162f1ecc1 (patch) | |
tree | 01a48b400c9dcb08a788eadd5669cb8facefa938 | |
parent | f1d42c04764bed5f58d30bb00515514388c96a5c (diff) | |
download | gdb-7c726b6625a0310e63a2b046dc3b4a3162f1ecc1.zip gdb-7c726b6625a0310e63a2b046dc3b4a3162f1ecc1.tar.gz gdb-7c726b6625a0310e63a2b046dc3b4a3162f1ecc1.tar.bz2 |
* elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add sinterpptr
argument, and set it to the .interp section.
* bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype.
(bfd_elf64_size_dynamic_sections): Likewise.
* bfd-in2.h: Rebuilt.
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/bfd-in.h | 4 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 4 | ||||
-rw-r--r-- | bfd/elfcode.h | 30 |
4 files changed, 28 insertions, 16 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 7f1406f..adf84f9 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,11 @@ Wed Jun 15 01:34:07 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add sinterpptr + argument, and set it to the .interp section. + * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype. + (bfd_elf64_size_dynamic_sections): Likewise. + * bfd-in2.h: Rebuilt. + * coff-sparc.c (SWAP_OUT_RELOC_EXTRA): Define to clear the r_spare field of the reloc rather than letting it be garbage. diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index 5e8fa63..645f24b 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -532,9 +532,9 @@ extern boolean bfd_elf32_record_link_assignment extern boolean bfd_elf64_record_link_assignment PARAMS ((bfd *, struct bfd_link_info *, const char *)); extern boolean bfd_elf32_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); + PARAMS ((bfd *, struct bfd_link_info *, struct sec **)); extern boolean bfd_elf64_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); + PARAMS ((bfd *, struct bfd_link_info *, struct sec **)); /* SunOS shared library support routines for the linker. */ diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 0baeb16..39bda1e 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -532,9 +532,9 @@ extern boolean bfd_elf32_record_link_assignment extern boolean bfd_elf64_record_link_assignment PARAMS ((bfd *, struct bfd_link_info *, const char *)); extern boolean bfd_elf32_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); + PARAMS ((bfd *, struct bfd_link_info *, struct sec **)); extern boolean bfd_elf64_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); + PARAMS ((bfd *, struct bfd_link_info *, struct sec **)); /* SunOS shared library support routines for the linker. */ diff --git a/bfd/elfcode.h b/bfd/elfcode.h index 0181a55..5cdd340 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -1278,17 +1278,6 @@ assign_section_numbers (abfd) section_number = 1; - t->shstrtab_section = section_number++; - elf_elfheader (abfd)->e_shstrndx = t->shstrtab_section; - t->shstrtab_hdr.sh_size = elf_shstrtab (abfd)->length; - t->shstrtab_hdr.contents = (PTR) elf_shstrtab (abfd)->tab; - - if (abfd->symcount > 0) - { - t->symtab_section = section_number++; - t->strtab_section = section_number++; - } - for (sec = abfd->sections; sec; sec = sec->next) { struct bfd_elf_section_data *d = elf_section_data (sec); @@ -1300,6 +1289,17 @@ assign_section_numbers (abfd) d->rel_idx = section_number++; } + t->shstrtab_section = section_number++; + elf_elfheader (abfd)->e_shstrndx = t->shstrtab_section; + t->shstrtab_hdr.sh_size = elf_shstrtab (abfd)->length; + t->shstrtab_hdr.contents = (PTR) elf_shstrtab (abfd)->tab; + + if (abfd->symcount > 0) + { + t->symtab_section = section_number++; + t->strtab_section = section_number++; + } + elf_elfheader (abfd)->e_shnum = section_number; /* Set up the list of section header pointers, in agreement with the @@ -4735,9 +4735,10 @@ static const size_t elf_buckets[] = addresses of the various sections. */ boolean -NAME(bfd_elf,size_dynamic_sections) (output_bfd, info) +NAME(bfd_elf,size_dynamic_sections) (output_bfd, info, sinterpptr) bfd *output_bfd; struct bfd_link_info *info; + asection **sinterpptr; { bfd *dynobj; size_t dynsymcount; @@ -4747,6 +4748,8 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, info) size_t bucketcount; struct elf_backend_data *bed; + *sinterpptr = NULL; + dynobj = elf_hash_table (info)->dynobj; dynsymcount = elf_hash_table (info)->dynsymcount; @@ -4755,6 +4758,9 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, info) if (dynobj == NULL) return true; + *sinterpptr = bfd_get_section_by_name (dynobj, ".interp"); + BFD_ASSERT (*sinterpptr != NULL); + /* Set the size of the .dynsym and .hash sections. We counted the number of dynamic symbols in elf_link_add_object_symbols. We will build the contents of .dynsym and .hash when we build the |