From 215c0b332083c717b94b4a204294027971fb43c5 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 7 Apr 2015 06:47:37 -0700 Subject: Add elf-options.c --- ld/elf-options.c | 123 ++++++++++++++++++++++++++++++++++++++++++ ld/emultempl/elf-options.em | 126 -------------------------------------------- ld/ldemul.h | 1 + 3 files changed, 124 insertions(+), 126 deletions(-) create mode 100644 ld/elf-options.c delete mode 100644 ld/emultempl/elf-options.em diff --git a/ld/elf-options.c b/ld/elf-options.c new file mode 100644 index 00000000000..b3e8d35ef70 --- /dev/null +++ b/ld/elf-options.c @@ -0,0 +1,123 @@ +/* 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. */ + +#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, _("\ + --disable-new-dtags Disable new dynamic tags\n")); + fprintf (file, _("\ + --enable-new-dtags Enable new dynamic tags\n")); + fprintf (file, _("\ + --eh-frame-hdr Create .eh_frame_hdr section\n")); + fprintf (file, _("\ + --exclude-libs=LIBS Make all symbols in LIBS hidden\n")); + 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, _("\ + -z initfirst Mark DSO to be initialized first at runtime\n")); + fprintf (file, _("\ + -z interpose Mark object to interpose all DSOs but executable\n")); + fprintf (file, _("\ + -z lazy Mark object lazy runtime binding (default)\n")); + fprintf (file, _("\ + -z loadfltr Mark object requiring immediate process\n")); + fprintf (file, _("\ + -z nocopyreloc Don't create copy relocs\n")); + fprintf (file, _("\ + -z nodefaultlib Mark object not to use default search paths\n")); + fprintf (file, _("\ + -z nodelete Mark DSO non-deletable at runtime\n")); + fprintf (file, _("\ + -z nodlopen Mark DSO not available to dlopen\n")); + fprintf (file, _("\ + -z nodump Mark DSO not available to dldump\n")); + fprintf (file, _("\ + -z now Mark object non-lazy runtime binding\n")); + fprintf (file, _("\ + -z origin Mark object requiring immediate \$ORIGIN\n\ + processing at runtime\n")); + 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")); +} + +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, _("\ + -z common-page-size=SIZE Set common page size to SIZE\n")); + fprintf (file, _("\ + -z max-page-size=SIZE Set maximum page size to SIZE\n")); + fprintf (file, _("\ + -z defs Report unresolved symbols in object files.\n")); + fprintf (file, _("\ + -z muldefs Allow multiple definitions\n")); + fprintf (file, _("\ + -z execstack Mark executable as requiring executable stack\n")); + fprintf (file, _("\ + -z noexecstack Mark executable as not requiring executable stack\n")); +} + +void +gldelf_list_options (FILE * file, bfd_boolean shlib) +{ + gldelf_static_list_options (); + if (shlib) + gldelf_shlib_list_options (); +} diff --git a/ld/emultempl/elf-options.em b/ld/emultempl/elf-options.em deleted file mode 100644 index 6e81aedae53..00000000000 --- a/ld/emultempl/elf-options.em +++ /dev/null @@ -1,126 +0,0 @@ -# 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 <