This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Add ld_list_options
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Wed, 8 Apr 2015 17:22:10 -0700
- Subject: Re: [PATCH] Add ld_list_options
- Authentication-results: sourceware.org; auth=none
- References: <20150407171257 dot GA28936 at intel dot com> <1428509754 dot 30498 dot 97 dot camel at ubuntu-sellcey> <1428510731 dot 30498 dot 98 dot camel at ubuntu-sellcey> <CAMe9rOrsHbqb2cXjup_GJjz6++QtK+d6i57hJLPjc5sELNf-QQ at mail dot gmail dot com> <20150408233116 dot GD27812 at bubble dot grove dot modra dot org> <CAMe9rOpw+Jk55t=2NDWD2RfPj_rPL6CFSrW-Z+7WsuCMqk1rEQ at mail dot gmail dot com>
On Wed, Apr 8, 2015 at 5:10 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> Also, please make use of EXTRA_EM_FILE to move the BNDPLT code out of
>> elf32.em.
>>
>
> I will take care of it tomorrow.
>
I will check in this tomorrow.
--
H.J.
diff --git a/ld/emulparams/elf_x86_64.sh b/ld/emulparams/elf_x86_64.sh
index aa26a1b..984e5e9 100644
--- a/ld/emulparams/elf_x86_64.sh
+++ b/ld/emulparams/elf_x86_64.sh
@@ -36,7 +36,14 @@ case "$target" in
case "$EMULATION_NAME" in
*64*)
LIBPATH_SUFFIX=64
- BNDPLT=yes
+ PARSE_AND_LIST_OPTIONS='
+ fprintf (file, _("\
+ -z bndplt Always generate BND prefix in PLT entries\n"));
+'
+ PARSE_AND_LIST_ARGS_CASE_Z='
+ else if (strcmp (optarg, "bndplt") == 0)
+ link_info.bndplt = TRUE;
+'
;;
esac
;;
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index dc643b6..5db5a93 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -2286,13 +2286,6 @@ fragment <<EOF
}
EOF
-if test x"$BNDPLT" = xyes; then
-fragment <<EOF
- else if (strcmp (optarg, "bndplt") == 0)
- link_info.bndplt = TRUE;
-EOF
-fi
-
if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
fragment <<EOF
else if (strcmp (optarg, "global") == 0)
@@ -2345,6 +2338,12 @@ fragment <<EOF
EOF
fi
+if test -n "$PARSE_AND_LIST_ARGS_CASE_Z" ; then
+fragment <<EOF
+ $PARSE_AND_LIST_ARGS_CASE_Z
+EOF
+fi
+
fragment <<EOF
else
einfo (_("%P: warning: -z %s ignored.\n"), optarg);
@@ -2367,7 +2366,7 @@ EOF
if test x"$LDEMUL_LIST_OPTIONS" != xgld"$EMULATION_NAME"_list_options; then
gld_list_options="gld${EMULATION_NAME}_list_options"
-if test -n "$PARSE_AND_LIST_OPTIONS" || test x"$BNDPLT" = xyes; then
+if test -n "$PARSE_AND_LIST_OPTIONS"; then
fragment <<EOF
static void
@@ -2375,13 +2374,6 @@ gld${EMULATION_NAME}_list_options (FILE * file)
{
EOF
-if test x"$BNDPLT" = xyes; then
-fragment <<EOF
- fprintf (file, _("\
- -z bndplt Always generate BND prefix in PLT entries\n"));
-EOF
-fi
-
if test -n "$PARSE_AND_LIST_OPTIONS" ; then
fragment <<EOF
$PARSE_AND_LIST_OPTIONS