summaryrefslogtreecommitdiffstats
path: root/src/ld.c
diff options
context:
space:
mode:
authorUlrich Drepper <[email protected]>2008-01-25 00:18:42 +0000
committerUlrich Drepper <[email protected]>2008-01-25 00:18:42 +0000
commit0e864dd86871c809668c557985ca19344dfff787 (patch)
treefb5da423ce53ff895f7f763bd8b50d334240aac2 /src/ld.c
parent5449a6b315822ad80f18ae497d89b5c329f94b02 (diff)
Remove magic assignment of indeces in the dynsym
section. Start implementation of --hash-style.
Diffstat (limited to 'src/ld.c')
-rw-r--r--src/ld.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ld.c b/src/ld.c
index 4ac3023a..24d5cb3d 100644
--- a/src/ld.c
+++ b/src/ld.c
@@ -73,6 +73,7 @@ enum
ARGP_as_needed,
ARGP_no_as_needed,
ARGP_eh_frame_hdr,
+ ARGP_hash_style,
#if YYDEBUG
ARGP_yydebug,
#endif
@@ -167,6 +168,8 @@ Default rules of extracting from archive; weak references are not enough."),
0 },
{ "eh-frame-hdr", ARGP_eh_frame_hdr, NULL, 0,
N_("Create .eh_frame_hdr section"), 0 },
+ { "hash-style", ARGP_hash_style, "STYLE", 0,
+ N_("Set hash style to sysv, gnu or both."), 0 },
{ NULL, 0, NULL, 0, N_("Linker Operation Control:"), 0 },
{ "verbose", 'v', NULL, 0, N_("Verbose messages."), 0 },
@@ -328,6 +331,11 @@ main (int argc, char *argv[])
/* Determine which ELF backend to use. */
determine_output_format ();
+ /* If no hash style was specific default to the oldand slow SysV
+ method. */
+ if (unlikely (ld_state.hash_style == hash_style_none))
+ ld_state.hash_style = hash_style_sysv;
+
/* Prepare state. */
err = ld_prepare_state (emulation);
if (err != 0)
@@ -611,6 +619,17 @@ parse_opt_1st (int key, char *arg,
ld_state.eh_frame_hdr = true;
break;
+ case ARGP_hash_style:
+ if (strcmp (arg, "gnu") == 0)
+ ld_state.hash_style = hash_style_gnu;
+ else if (strcmp (arg, "both") == 0)
+ ld_state.hash_style = hash_style_gnu | hash_style_sysv;
+ else if (strcmp (arg, "sysv") == 0)
+ ld_state.hash_style = hash_style_sysv;
+ else
+ error (EXIT_FAILURE, 0, gettext ("invalid hash style '%s'"), arg);
+ break;
+
case 's':
if (arg == NULL)
{