diff options
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 10 | ||||
-rw-r--r-- | ld/emultempl/elf32.em | 19 | ||||
-rw-r--r-- | ld/ld.texinfo | 8 | ||||
-rw-r--r-- | ld/ldmain.c | 2 | ||||
-rw-r--r-- | ld/scripttempl/elf.sc | 1 | ||||
-rw-r--r-- | ld/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/tlsso.g | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/tlsso.r | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/tlsso32.d | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/tlsso32.g | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/tlsso32.r | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/tlstocso.g | 2 |
12 files changed, 59 insertions, 10 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 1d1cc1b10e9..24141f654d2 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,13 @@ +2006-07-10 Jakub Jelinek <jakub@redhat.com> + + * 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. + 2006-07-10 Nick Clifton <nickc@redhat.com> * po/zh_TW.po: New Chinese (traditional) translation. diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 9eb532386db..7ce112a1c16 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -1719,6 +1719,7 @@ cat >>e${EMULATION_NAME}.c <<EOF #define OPTION_GROUP (OPTION_ENABLE_NEW_DTAGS + 1) #define OPTION_EH_FRAME_HDR (OPTION_GROUP + 1) #define OPTION_EXCLUDE_LIBS (OPTION_EH_FRAME_HDR + 1) +#define OPTION_HASH_STYLE (OPTION_EXCLUDE_LIBS + 1) static void gld${EMULATION_NAME}_add_options @@ -1735,6 +1736,7 @@ cat >>e${EMULATION_NAME}.c <<EOF {"enable-new-dtags", no_argument, NULL, OPTION_ENABLE_NEW_DTAGS}, {"eh-frame-hdr", no_argument, NULL, OPTION_EH_FRAME_HDR}, {"exclude-libs", required_argument, NULL, OPTION_EXCLUDE_LIBS}, + {"hash-style", required_argument, NULL, OPTION_HASH_STYLE}, {"Bgroup", no_argument, NULL, OPTION_GROUP}, EOF fi @@ -1791,6 +1793,22 @@ cat >>e${EMULATION_NAME}.c <<EOF add_excluded_libs (optarg); break; + case OPTION_HASH_STYLE: + link_info.emit_hash = FALSE; + link_info.emit_gnu_hash = FALSE; + if (strcmp (optarg, "sysv") == 0) + link_info.emit_hash = TRUE; + else if (strcmp (optarg, "gnu") == 0) + link_info.emit_gnu_hash = TRUE; + else if (strcmp (optarg, "both") == 0) + { + link_info.emit_hash = TRUE; + link_info.emit_gnu_hash = TRUE; + } + else + einfo (_("%P%F: invalid hash style \`%s'\n"), optarg); + break; + case 'z': if (strcmp (optarg, "initfirst") == 0) link_info.flags_1 |= (bfd_vma) DF_1_INITFIRST; @@ -1894,6 +1912,7 @@ cat >>e${EMULATION_NAME}.c <<EOF fprintf (file, _(" --disable-new-dtags\tDisable new dynamic tags\n")); fprintf (file, _(" --enable-new-dtags\tEnable new dynamic tags\n")); fprintf (file, _(" --eh-frame-hdr\tCreate .eh_frame_hdr section\n")); + fprintf (file, _(" --hash-style=STYLE\tSet hash style to sysv, gnu or both\n")); fprintf (file, _(" -z combreloc\t\tMerge dynamic relocs into one section and sort\n")); fprintf (file, _(" -z defs\t\tReport unresolved symbols in object files.\n")); fprintf (file, _(" -z execstack\t\tMark executable as requiring executable stack\n")); diff --git a/ld/ld.texinfo b/ld/ld.texinfo index 72a30449eb9..687f19c78c7 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -1883,6 +1883,14 @@ time it takes the linker to perform its tasks, at the expense of increasing the linker's memory requirements. Similarly reducing this value can reduce the memory requirements at the expense of speed. +@kindex --hash-style=@var{style} +@item --hash-style=@var{style} +Set the type of linker's hash table(s). @var{style} can be either +@code{sysv} for classic ELF @code{.hash} section, @code{gnu} for +new style GNU @code{.gnu.hash} section or @code{both} for both +the classic ELF @code{.hash} and new style GNU @code{.gnu.hash} +hash tables. The default is @code{sysv}. + @kindex --reduce-memory-overheads @item --reduce-memory-overheads This option reduces memory requirements at ld runtime, at the expense of diff --git a/ld/ldmain.c b/ld/ldmain.c index 88811904aed..ec31310d651 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -304,6 +304,8 @@ main (int argc, char **argv) link_info.create_object_symbols_section = NULL; link_info.gc_sym_list = NULL; link_info.base_file = NULL; + link_info.emit_hash = TRUE; + link_info.emit_gnu_hash = FALSE; /* SVR4 linkers seem to set DT_INIT and DT_FINI based on magic _init and _fini symbols. We are compatible. */ link_info.init_function = "_init"; diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc index ac0c7256e2e..ebe387e7e2d 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc @@ -260,6 +260,7 @@ SECTIONS ${INITIAL_READONLY_SECTIONS} ${TEXT_DYNAMIC+${DYNAMIC}} .hash ${RELOCATING-0} : { *(.hash) } + .gnu.hash ${RELOCATING-0} : { *(.gnu.hash) } .dynsym ${RELOCATING-0} : { *(.dynsym) } .dynstr ${RELOCATING-0} : { *(.dynstr) } .gnu.version ${RELOCATING-0} : { *(.gnu.version) } diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 35071425471..501335e077a 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2006-07-10 Jakub Jelinek <jakub@redhat.com> + + * 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. + 2006-07-05 Thiemo Seufer <ths@mips.com> * ld-mips-elf/multi-got-1.d, ld-mips-elf/tls-multi-got-1.got, diff --git a/ld/testsuite/ld-powerpc/tlsso.g b/ld/testsuite/ld-powerpc/tlsso.g index caef9dd503e..6113155fab9 100644 --- a/ld/testsuite/ld-powerpc/tlsso.g +++ b/ld/testsuite/ld-powerpc/tlsso.g @@ -7,7 +7,7 @@ .*: +file format elf64-powerpc Contents of section \.got: -.* 00000000 000187f0 00000000 00000000 .* +.* 00000000 000187b8 00000000 00000000 .* .* 00000000 00000000 00000000 00000000 .* .* 00000000 00000000 00000000 00000000 .* .* 00000000 00000000 00000000 00000000 .* diff --git a/ld/testsuite/ld-powerpc/tlsso.r b/ld/testsuite/ld-powerpc/tlsso.r index e0e0f00e48e..db541547b44 100644 --- a/ld/testsuite/ld-powerpc/tlsso.r +++ b/ld/testsuite/ld-powerpc/tlsso.r @@ -49,9 +49,9 @@ Relocation section '\.rela\.dyn' at offset .* contains 16 entries: [0-9a-f ]+R_PPC64_TPREL16 +0+60 le0 \+ 0 [0-9a-f ]+R_PPC64_TPREL16_HA +0+68 le1 \+ 0 [0-9a-f ]+R_PPC64_TPREL16_LO +0+68 le1 \+ 0 -[0-9a-f ]+R_PPC64_TPREL16_DS +0+10668 \.tdata \+ 28 -[0-9a-f ]+R_PPC64_TPREL16_HA +0+10668 \.tdata \+ 30 -[0-9a-f ]+R_PPC64_TPREL16_LO +0+10668 \.tdata \+ 30 +[0-9a-f ]+R_PPC64_TPREL16_DS +0+10630 \.tdata \+ 28 +[0-9a-f ]+R_PPC64_TPREL16_HA +0+10630 \.tdata \+ 30 +[0-9a-f ]+R_PPC64_TPREL16_LO +0+10630 \.tdata \+ 30 [0-9a-f ]+R_PPC64_DTPMOD64 +0+ [0-9a-f ]+R_PPC64_DTPMOD64 +0+ [0-9a-f ]+R_PPC64_DTPREL64 +0+ diff --git a/ld/testsuite/ld-powerpc/tlsso32.d b/ld/testsuite/ld-powerpc/tlsso32.d index 45432db33e3..dafca7d34f6 100644 --- a/ld/testsuite/ld-powerpc/tlsso32.d +++ b/ld/testsuite/ld-powerpc/tlsso32.d @@ -42,5 +42,5 @@ Disassembly of section \.got: .* <\.got>: \.\.\. .*: 4e 80 00 21 blrl -.*: 00 01 04 38 .* +.*: 00 01 04 00 .* \.\.\. diff --git a/ld/testsuite/ld-powerpc/tlsso32.g b/ld/testsuite/ld-powerpc/tlsso32.g index 7014419a691..c097ffa3451 100644 --- a/ld/testsuite/ld-powerpc/tlsso32.g +++ b/ld/testsuite/ld-powerpc/tlsso32.g @@ -9,5 +9,5 @@ Contents of section \.got: .* 00000000 00000000 00000000 00000000 .* .* 00000000 00000000 00000000 00000000 .* -.* 00000000 4e800021 00010438 00000000 .* +.* 00000000 4e800021 00010400 00000000 .* .* 00000000 .* diff --git a/ld/testsuite/ld-powerpc/tlsso32.r b/ld/testsuite/ld-powerpc/tlsso32.r index 7044c356e0a..a0ede5f5bef 100644 --- a/ld/testsuite/ld-powerpc/tlsso32.r +++ b/ld/testsuite/ld-powerpc/tlsso32.r @@ -52,9 +52,9 @@ Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 18 entries: [0-9a-f ]+R_PPC_TPREL16 +0+30 +le0 \+ 0 [0-9a-f ]+R_PPC_TPREL16_HA +0+34 +le1 \+ 0 [0-9a-f ]+R_PPC_TPREL16_LO +0+34 +le1 \+ 0 -[0-9a-f ]+R_PPC_TPREL16 +0+1041c +\.tdata \+ 10430 -[0-9a-f ]+R_PPC_TPREL16_HA +0+1041c +\.tdata \+ 10434 -[0-9a-f ]+R_PPC_TPREL16_LO +0+1041c +\.tdata \+ 10434 +[0-9a-f ]+R_PPC_TPREL16 +0+103e4 +\.tdata \+ 103f8 +[0-9a-f ]+R_PPC_TPREL16_HA +0+103e4 +\.tdata \+ 103fc +[0-9a-f ]+R_PPC_TPREL16_LO +0+103e4 +\.tdata \+ 103fc [0-9a-f ]+R_PPC_DTPMOD32 +0+ [0-9a-f ]+R_PPC_DTPREL32 +0+ [0-9a-f ]+R_PPC_DTPMOD32 +0+ diff --git a/ld/testsuite/ld-powerpc/tlstocso.g b/ld/testsuite/ld-powerpc/tlstocso.g index b5d7d647cc2..3d59c435f9d 100644 --- a/ld/testsuite/ld-powerpc/tlstocso.g +++ b/ld/testsuite/ld-powerpc/tlstocso.g @@ -7,7 +7,7 @@ .*: +file format elf64-powerpc Contents of section \.got: -.* 00000000 00018738 00000000 00000000 .* +.* 00000000 00018700 00000000 00000000 .* .* 00000000 00000000 00000000 00000000 .* .* 00000000 00000000 00000000 00000000 .* .* 00000000 00000000 00000000 00000000 .* |