From ec42f922fd431529ac48f465b74d26c2bf9b852b Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 20 Jul 2000 03:25:10 +0000 Subject: [PATCH] 2000-07-19 H.J. Lu * emulparams/elf32mcore.sh (PARSE_AND_LIST_ARGS): Removed. (PARSE_AND_LIST_PROLOGUE): New. (PARSE_AND_LIST_LONGOPTS): Likewise. (PARSE_AND_LIST_OPTIONS): Likewise. (PARSE_AND_LIST_ARGS_CASES): Likewise. * ldmain.c (main): Clear link_info.flags and link_info.flags_1. * lexsup.c (ld_options): Comment out 'z'. (parse_args): Likewise. * emultempl/elf32.em: Include "elf/common.h". (gld_${EMULATION_NAME}_parse_args): Defined. Handle some -z options. (gld_${EMULATION_NAME}_list_options): Likewise. * ld.texinfo: Add documentation for the recognized -z options. --- ld/ChangeLog | 20 ++++++ ld/emulparams/elf32mcore.sh | 57 +++------------- ld/emultempl/elf32.em | 154 +++++++++++++++++++++++++++++++++++++++++++- ld/ld.texinfo | 16 ++++- ld/ldmain.c | 2 + ld/lexsup.c | 4 ++ 6 files changed, 201 insertions(+), 52 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index db2966391..2baeea798 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,25 @@ 2000-07-19 H.J. Lu + * elf32-arm.h (elf32_arm_size_dynamic_sections): Also set + DF_TEXTREL if DT_TEXTREL is set. + * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise. + * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise. + * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. + * elf32-mips.c (_bfd_mips_elf_size_dynamic_sections): Likewise. + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. + * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise. + * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise. + * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. + * elf64-ia64.c (elf64_ia64_size_dynamic_sections): Likewise. + * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Likewise. + + * bfd/elflink.h (NAME(bfd_elf,size_dynamic_sections)): Also + set DF_SYMBOLIC for symbolic link. Also set DT_RUNPATH if + DT_RPATH is set. + Set the DT_FLAGS and DT_FLAGS_1 entries if necessary. + +2000-07-19 H.J. Lu + * emultempl/elf32.em (gld${EMULATION_NAME}_try_needed): Call bfd_elf_set_dt_needed_soname (). diff --git a/ld/emulparams/elf32mcore.sh b/ld/emulparams/elf32mcore.sh index b1f7b8c0f..2d0638730 100644 --- a/ld/emulparams/elf32mcore.sh +++ b/ld/emulparams/elf32mcore.sh @@ -33,54 +33,20 @@ GENERATE_SHLIB_SCRIPT=yes # This code gets inserted into the generic elf32.sc linker script # and allows us to define our own command line switches. -PARSE_AND_LIST_ARGS=' - +PARSE_AND_LIST_PROLOGUE=' #define OPTION_BASE_FILE 300 +' -#include "getopt.h" - -static struct option longopts[] = -{ +PARSE_AND_LIST_LONGOPTS=' {"base-file", required_argument, NULL, OPTION_BASE_FILE}, - {NULL, no_argument, NULL, 0} -}; - -static void -gld_elf32mcore_list_options (file) - FILE * file; -{ - fprintf (file, _(" --base_file Generate a base file for relocatable DLLs\n")); -} - -static int -gld_elf32mcore_parse_args (argc, argv) - int argc; - char ** argv; -{ - int longind; - int optc; - int prevoptind = optind; - int prevopterr = opterr; - int wanterror; - static int lastoptind = -1; - - if (lastoptind != optind) - opterr = 0; - - wanterror = opterr; - lastoptind = optind; - - optc = getopt_long_only (argc, argv, "-", longopts, & longind); - opterr = prevopterr; +' - switch (optc) - { - default: - if (wanterror) - xexit (1); - optind = prevoptind; - return 0; +PARSE_AND_LIST_OPTIONS=' + fprintf (file, _(" --base_file \n")); + fprintf (file, _("\t\t\tGenerate a base file for relocatable DLLs\n")); +' +PARSE_AND_LIST_ARGS_CASES=' case OPTION_BASE_FILE: link_info.base_file = (PTR) fopen (optarg, FOPEN_WB); if (link_info.base_file == NULL) @@ -91,9 +57,4 @@ gld_elf32mcore_parse_args (argc, argv) xexit (1); } break; - } - - return 1; -} - ' diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 3cdb85686..0e4464dce 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -45,6 +45,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ldfile.h" #include "ldemul.h" #include "ldgram.h" +#include "elf/common.h" static void gld${EMULATION_NAME}_before_parse PARAMS ((void)); static boolean gld${EMULATION_NAME}_open_dynamic_archive @@ -1184,14 +1185,15 @@ EOF fi -if test -n "$PARSE_AND_LIST_ARGS" ; then +if test -n "$PARSE_AND_LIST_ARGS_CASES" || test x"$GENERATE_SHLIB_SCRIPT" = xyes; then +NEED_PARSE_AND_LIST=yes + cat >>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <