aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-07-10 21:40:25 +0000
committerJakub Jelinek <jakub@redhat.com>2006-07-10 21:40:25 +0000
commitfdc90cb46b0f96dd4444ec3d126c87de75fb6e6b (patch)
tree4ffde6484836dfa2b50c27ba8a68b187effb5348 /include
parent8a112c90fe342a045c82485eb3b1ef65f7c735f3 (diff)
downloadfsf-binutils-gdb-fdc90cb46b0f96dd4444ec3d126c87de75fb6e6b.zip
fsf-binutils-gdb-fdc90cb46b0f96dd4444ec3d126c87de75fb6e6b.tar.gz
fsf-binutils-gdb-fdc90cb46b0f96dd4444ec3d126c87de75fb6e6b.tar.bz2
include/
* bfdlink.h (struct bfd_link_info): Add emit_hash and emit_gnu_hash bitfields. include/elf/ * common.h (SHT_GNU_HASH, DT_GNU_HASH): Define. ld/ * scripttempl/elf.sc: Add .gnu.hash section. * emultempl/elf32.em (OPTION_HASH_STYLE): Define. (gld${EMULATION_NAME}_add_options): Register --hash-style option. (gld${EMULATION_NAME}_handle_option): Handle it. (gld${EMULATION_NAME}_list_options): Document it. * ldmain.c (main): Initialize emit_hash and emit_gnu_hash. * ld.texinfo: Document --hash-style option. bfd/ * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_GNU_HASH. (bfd_section_from_shdr, elf_fake_sections, assign_section_numbers): Handle SHT_GNU_HASH. (special_sections_g): Include .gnu.hash section. (bfd_elf_gnu_hash): New function. * elf-bfd.h (bfd_elf_gnu_hash, _bfd_elf_hash_symbol): New prototypes. (struct elf_backend_data): Add elf_hash_symbol method. * elflink.c (_bfd_elf_link_create_dynamic_sections): Create .hash only if info->emit_hash, create .gnu.hash section if info->emit_gnu_hash. (struct collect_gnu_hash_codes): New type. (elf_collect_gnu_hash_codes, elf_renumber_gnu_hash_syms, _bfd_elf_hash_symbol): New functions. (compute_bucket_count): Don't compute HASHCODES array, instead add that and NSYMS as arguments. Use bed->s->sizeof_hash_entry instead of bed->s->arch_size / 8. Fix .hash size estimation. When not optimizing, use the number of hashed symbols rather than dynsymcount. (bfd_elf_size_dynamic_sections): Only add DT_HASH if info->emit_hash, and ADD DT_GNU_HASH if info->emit_gnu_hash. (bfd_elf_size_dynsym_hash_dynstr): Size .hash only if info->emit_hash, adjust compute_bucket_count caller. Create and populate .gnu.hash section if info->emit_gnu_hash. (elf_link_output_extsym): Only populate .hash section if finfo->hash_sec != NULL. (bfd_elf_final_link): Adjust assertion. Handle DT_GNU_HASH. * elfxx-target.h (elf_backend_hash_symbol): Define if not yet defined. (elfNN_bed): Add elf_backend_hash_symbol. * elf64-x86-64.c (elf64_x86_64_hash_symbol): New function. (elf_backend_hash_symbol): Define. * elf32-i386.c (elf_i386_hash_symbol): New function. (elf_backend_hash_symbol): Define. binutils/ * readelf.c (get_dynamic_type): Handle DT_GNU_HASH. (get_section_type_name): Handle SHT_GNU_HASH. (dynamic_info_DT_GNU_HASH): New variable. (process_dynamic_section): Handle DT_GNU_HASH. (process_symbol_table): Print also DT_GNU_HASH histogram. ld/testsuite/ * ld-powerpc/tlsso32.r: Adjust. * ld-powerpc/tlsso32.d: Adjust. * ld-powerpc/tlsso32.g: Adjust. * ld-powerpc/tlsso.r: Adjust. * ld-powerpc/tlsso.g: Adjust. * ld-powerpc/tlstocso.g: Adjust.
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog5
-rw-r--r--include/bfdlink.h6
-rw-r--r--include/elf/ChangeLog4
-rw-r--r--include/elf/common.h2
4 files changed, 17 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 6f695ff..75f1ed2 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,8 @@
+2006-07-10 Jakub Jelinek <jakub@redhat.com>
+
+ * bfdlink.h (struct bfd_link_info): Add emit_hash and
+ emit_gnu_hash bitfields.
+
2006-04-11 Jim Blandy <jimb@codesourcery.com>
* libiberty.h (pex_input_file, pex_input_pipe): New declarations.
diff --git a/include/bfdlink.h b/include/bfdlink.h
index f4b7aa7..761bd05 100644
--- a/include/bfdlink.h
+++ b/include/bfdlink.h
@@ -324,6 +324,12 @@ struct bfd_link_info
/* TRUE if unreferenced sections should be removed. */
unsigned int gc_sections: 1;
+ /* TRUE if .hash section should be created. */
+ unsigned int emit_hash: 1;
+
+ /* TRUE if .gnu.hash section should be created. */
+ unsigned int emit_gnu_hash: 1;
+
/* What to do with unresolved symbols in an object file.
When producing executables the default is GENERATE_ERROR.
When producing shared libraries the default is IGNORE. The
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index 285457e..f1c15b5 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,7 @@
+2006-07-10 Jakub Jelinek <jakub@redhat.com>
+
+ * common.h (SHT_GNU_HASH, DT_GNU_HASH): Define.
+
2006-05-31 H.J. Lu <hongjiu.lu@intel.com>
* internal.h (ELF_SECTION_SIZE): New.
diff --git a/include/elf/common.h b/include/elf/common.h
index b11171b..0380a8f 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -338,6 +338,7 @@
#define SHT_LOOS 0x60000000 /* First of OS specific semantics */
#define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */
+#define SHT_GNU_HASH 0x6ffffff6 /* GNU style symbol hash table */
#define SHT_GNU_LIBLIST 0x6ffffff7 /* List of prelink dependencies */
/* The next three section types are defined by Solaris, and are named
@@ -577,6 +578,7 @@
#define DT_VALRNGHI 0x6ffffdff
#define DT_ADDRRNGLO 0x6ffffe00
+#define DT_GNU_HASH 0x6ffffef5
#define DT_TLSDESC_PLT 0x6ffffef6
#define DT_TLSDESC_GOT 0x6ffffef7
#define DT_GNU_CONFLICT 0x6ffffef8