diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2015-04-07 06:47:37 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2015-04-07 06:47:37 -0700 |
commit | 215c0b332083c717b94b4a204294027971fb43c5 (patch) | |
tree | f482007df1bb0b10c8ca393c3e4bacd580a85e5b | |
parent | c21e79f27abcdda66218594ecdd449dc9eab9653 (diff) | |
download | binutils-gdb-215c0b332083c717b94b4a204294027971fb43c5.tar.gz |
Add elf-options.c
-rw-r--r-- | ld/elf-options.c (renamed from ld/emultempl/elf-options.em) | 81 | ||||
-rw-r--r-- | ld/ldemul.h | 1 |
2 files changed, 40 insertions, 42 deletions
diff --git a/ld/emultempl/elf-options.em b/ld/elf-options.c index 6e81aedae53..b3e8d35ef70 100644 --- a/ld/emultempl/elf-options.em +++ b/ld/elf-options.c @@ -1,27 +1,3 @@ -# This shell script emits a C file. -*- C -*- -# Copyright (C) 2015 Free Software Foundation, Inc. -# -# This file is part of the GNU Binutils. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -# MA 02110-1301, USA. -# - -fragment <<EOF -/* This file is is generated by a shell script. DO NOT EDIT! */ - /* Copyright (C) 2015 Free Software Foundation, Inc. This file is part of the GNU Binutils. @@ -41,17 +17,23 @@ fragment <<EOF Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -void -gld_shlib_list_options (FILE * file) +#include "sysdep.h" +#include "bfd.h" +#include "ldemul.h" + +static void +gldelf_shlib_list_options (FILE * file) { + static bfd_boolean done; + if (!done) + return; + done = TRUE; + fprintf (file, _("\ --audit=AUDITLIB Specify a library to use for auditing\n")); fprintf (file, _("\ -Bgroup Selects group name lookup rules for DSO\n")); fprintf (file, _("\ - -P AUDITLIB, --depaudit=AUDITLIB\n" "\ - Specify a library to use for auditing dependencies\n")); - fprintf (file, _("\ --disable-new-dtags Disable new dynamic tags\n")); fprintf (file, _("\ --enable-new-dtags Enable new dynamic tags\n")); @@ -62,8 +44,13 @@ gld_shlib_list_options (FILE * file) fprintf (file, _("\ --hash-style=STYLE Set hash style to sysv, gnu or both\n")); fprintf (file, _("\ + -P AUDITLIB, --depaudit=AUDITLIB\n" "\ + Specify a library to use for auditing dependencies\n")); + fprintf (file, _("\ -z combreloc Merge dynamic relocs into one section and sort\n")); fprintf (file, _("\ + -z nocombreloc Don't merge dynamic relocs into one section\n")); + fprintf (file, _("\ -z global Make symbols in DSO available for subsequently\n\ loaded objects\n")); fprintf (file, _("\ @@ -75,8 +62,6 @@ gld_shlib_list_options (FILE * file) fprintf (file, _("\ -z loadfltr Mark object requiring immediate process\n")); fprintf (file, _("\ - -z nocombreloc Don't merge dynamic relocs into one section\n")); - fprintf (file, _("\ -z nocopyreloc Don't create copy relocs\n")); fprintf (file, _("\ -z nodefaultlib Mark object not to use default search paths\n")); @@ -87,14 +72,6 @@ gld_shlib_list_options (FILE * file) fprintf (file, _("\ -z nodump Mark DSO not available to dldump\n")); fprintf (file, _("\ - -z text Treat DT_TEXTREL in shared object as error\n")); - fprintf (file, _("\ - -z notext Don't treat DT_TEXTREL in shared object as error\n")); - fprintf (file, _("\ - -z textoff Don't treat DT_TEXTREL in shared object as error\n")); - fprintf (file, _("\ - -z norelro Don't create RELRO program header\n")); - fprintf (file, _("\ -z now Mark object non-lazy runtime binding\n")); fprintf (file, _("\ -z origin Mark object requiring immediate \$ORIGIN\n\ @@ -102,12 +79,25 @@ gld_shlib_list_options (FILE * file) fprintf (file, _("\ -z relro Create RELRO program header\n")); fprintf (file, _("\ + -z norelro Don't create RELRO program header\n")); + fprintf (file, _("\ + fprintf (file, _("\ -z stacksize=SIZE Set size of stack segment\n")); + -z text Treat DT_TEXTREL in shared object as error\n")); + fprintf (file, _("\ + -z notext Don't treat DT_TEXTREL in shared object as error\n")); + fprintf (file, _("\ + -z textoff Don't treat DT_TEXTREL in shared object as error\n")); } -void -gld_list_options (FILE * file) +static void +gldelf_static_list_options (FILE * file) { + static bfd_boolean done; + if (!done) + return; + done = TRUE; + fprintf (file, _("\ --build-id[=STYLE] Generate build ID note\n")); fprintf (file, _("\ @@ -123,4 +113,11 @@ gld_list_options (FILE * file) fprintf (file, _("\ -z noexecstack Mark executable as not requiring executable stack\n")); } -EOF + +void +gldelf_list_options (FILE * file, bfd_boolean shlib) +{ + gldelf_static_list_options (); + if (shlib) + gldelf_shlib_list_options (); +} diff --git a/ld/ldemul.h b/ld/ldemul.h index 8ec4dac06d6..92e90dd8f7b 100644 --- a/ld/ldemul.h +++ b/ld/ldemul.h @@ -96,6 +96,7 @@ extern struct bfd_elf_version_expr *ldemul_new_vers_pattern (struct bfd_elf_version_expr *); extern void ldemul_extra_map_file_text (bfd *, struct bfd_link_info *, FILE *); +extern void gldelf_list_options (FILE *, bfd_boolean); typedef struct ld_emulation_xfer_struct { /* Run before parsing the command line and script file. |