From 3f764659c7b9bc8eb30920d37a55d3371d649d8a Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 19 Aug 2004 07:47:25 +0000 Subject: * elf64-ppc.c (ppc64_elf_edit_opd): Support 16 byte long .opd entries (where fd_aux overlaps next entry's fd_func). Add non_overlapping argument, use it. (ppc64_elf_check_relocs, ppc64_elf_gc_mark_hook, adjust_opd_syms, ppc64_elf_size_stubs, ppc64_elf_relocate_section, ppc64_elf_output_symbol_hook): Use address / 8 instead of address / 24 as indexes into opd_sym_map/opd_adjust array. * elf64-ppc.h (ppc64_elf_edit_opd): Adjust prototype. * emultempl/ppc64elf.em (non_overlapping_opd): New variable. (ppc_before_allocation): Pass it to ppc64_elf_edit_opd). (OPTION_NON_OVERLAPPING_OPD): Define. (PARSE_AND_LIST_OPTIONS, PARSE_AND_LIST_ARGS_CASES): Add --non-overlapping-opd option. --- ld/emultempl/ppc64elf.em | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'ld/emultempl/ppc64elf.em') diff --git a/ld/emultempl/ppc64elf.em b/ld/emultempl/ppc64elf.em index 264d63e..094a4fb 100644 --- a/ld/emultempl/ppc64elf.em +++ b/ld/emultempl/ppc64elf.em @@ -51,6 +51,9 @@ static int emit_stub_syms = 0; static asection *toc_section = 0; +/* Whether to canonicalize .opd so that there are no overlapping + .opd entries. */ +static int non_overlapping_opd = 0; /* This is called before the input files are opened. We create a new fake input file to hold the stub sections. */ @@ -89,7 +92,7 @@ ppc_before_allocation (void) { if (stub_file != NULL) { - if (!ppc64_elf_edit_opd (output_bfd, &link_info)) + if (!ppc64_elf_edit_opd (output_bfd, &link_info, non_overlapping_opd)) { einfo ("%X%P: can not edit opd %E\n"); return; @@ -463,6 +466,7 @@ PARSE_AND_LIST_PROLOGUE=' #define OPTION_DOTSYMS (OPTION_STUBSYMS + 1) #define OPTION_NO_DOTSYMS (OPTION_DOTSYMS + 1) #define OPTION_NO_TLS_OPT (OPTION_NO_DOTSYMS + 1) +#define OPTION_NON_OVERLAPPING_OPD (OPTION_NO_TLS_OPT + 1) ' PARSE_AND_LIST_LONGOPTS=' @@ -471,6 +475,7 @@ PARSE_AND_LIST_LONGOPTS=' { "dotsyms", no_argument, NULL, OPTION_DOTSYMS }, { "no-dotsyms", no_argument, NULL, OPTION_NO_DOTSYMS }, { "no-tls-optimize", no_argument, NULL, OPTION_NO_TLS_OPT }, + { "non-overlapping-opd", no_argument, NULL, OPTION_NON_OVERLAPPING_OPD }, ' PARSE_AND_LIST_OPTIONS=' @@ -498,6 +503,10 @@ PARSE_AND_LIST_OPTIONS=' fprintf (file, _("\ --no-tls-optimize Don'\''t try to optimize TLS accesses.\n" )); + fprintf (file, _("\ + --non-overlapping-opd Canonicalize .opd, so that there are no overlapping\n\ + .opd entries.\n" + )); ' PARSE_AND_LIST_ARGS_CASES=' @@ -525,6 +534,10 @@ PARSE_AND_LIST_ARGS_CASES=' case OPTION_NO_TLS_OPT: notlsopt = 1; break; + + case OPTION_NON_OVERLAPPING_OPD: + non_overlapping_opd = 1; + break; ' # Put these extra ppc64elf routines in ld_${EMULATION_NAME}_emulation -- cgit v1.1