aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/emultempl/ppc32elf.em13
-rw-r--r--ld/emultempl/ppc64elf.em4
3 files changed, 18 insertions, 4 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 9ee555b..3801705 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-18 Alan Modra <amodra@gmail.com>
+
+ * emultempl/ppc32elf.em: Support optional --plt-align arg.
+ * emultempl/ppc64elf.em: Support negative --plt-align arg.
+
2018-01-17 Alan Modra <amodra@gmail.com>
* emultempl/ppc32elf.em (params): Init new field.
diff --git a/ld/emultempl/ppc32elf.em b/ld/emultempl/ppc32elf.em
index 4e71a78..3007fb2 100644
--- a/ld/emultempl/ppc32elf.em
+++ b/ld/emultempl/ppc32elf.em
@@ -271,7 +271,7 @@ if test -z "$VXWORKS_BASE_EM_FILE" ; then
{ "bss-plt", no_argument, NULL, OPTION_OLD_PLT },
{ "speculate-indirect-jumps", no_argument, NULL, OPTION_SPECULATE_INDIRECT_JUMPS },
{ "no-speculate-indirect-jumps", no_argument, NULL, OPTION_NO_SPECULATE_INDIRECT_JUMPS },
- { "plt-align", no_argument, NULL, OPTION_PLT_ALIGN },
+ { "plt-align", optional_argument, NULL, OPTION_PLT_ALIGN },
{ "no-plt-align", no_argument, NULL, OPTION_NO_PLT_ALIGN },
{ "sdata-got", no_argument, NULL, OPTION_OLD_GOT },'
fi
@@ -369,7 +369,16 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}'
break;
case OPTION_PLT_ALIGN:
- params.plt_stub_align = 5;
+ if (optarg != NULL)
+ {
+ char *end;
+ unsigned long val = strtoul (optarg, &end, 0);
+ if (*end || val > 5)
+ einfo (_("%P%F: invalid --plt-align `%s'\''\n"), optarg);
+ params.plt_stub_align = val;
+ }
+ else
+ params.plt_stub_align = 5;
break;
case OPTION_NO_PLT_ALIGN:
diff --git a/ld/emultempl/ppc64elf.em b/ld/emultempl/ppc64elf.em
index c7c27b0..0baa424 100644
--- a/ld/emultempl/ppc64elf.em
+++ b/ld/emultempl/ppc64elf.em
@@ -872,8 +872,8 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}'
if (optarg != NULL)
{
char *end;
- unsigned long val = strtoul (optarg, &end, 0);
- if (*end || val > 8)
+ long val = strtol (optarg, &end, 0);
+ if (*end || (unsigned long) val + 8 > 16)
einfo (_("%P%F: invalid --plt-align `%s'\''\n"), optarg);
params.plt_stub_align = val;
}