/* TRUE if maxpagesize is set on command-line. */
unsigned int maxpagesize_is_set : 1;
+ /* TRUE if commonpagesize is set on command-line. */
+ unsigned int commonpagesize_is_set : 1;
+
/* Char that may appear as the first char of a symbol, but should be
skipped (like symbol_leading_char) when looking up symbols in
wrap_hash. Used by PowerPC Linux for 'dot' symbols. */
|| (link_info.commonpagesize & (link_info.commonpagesize - 1)) != 0)
einfo (_("%F%P: invalid common page size \`%s'\n"),
optarg + 17);
+ link_info.commonpagesize_is_set = true;
}
else if (startswith (optarg, "stack-size="))
{
after_parse_default ();
if (link_info.commonpagesize > link_info.maxpagesize)
- einfo (_("%F%P: common page size (0x%v) > maximum page size (0x%v)\n"),
- link_info.commonpagesize, link_info.maxpagesize);
+ {
+ if (!link_info.commonpagesize_is_set)
+ link_info.commonpagesize = link_info.maxpagesize;
+ else if (!link_info.maxpagesize_is_set)
+ link_info.maxpagesize = link_info.commonpagesize;
+ else
+ einfo (_("%F%P: common page size (0x%v) > maximum page size (0x%v)\n"),
+ link_info.commonpagesize, link_info.maxpagesize);
+ }
}
/* Handle the generation of DT_NEEDED tags. */
run_ld_link_exec_tests [list \
[list \
"Run mbind2a" \
- "$NOPIE_LDFLAGS -Wl,-z,common-page-size=0x4000,-z,max-page-size=0x4000" \
+ "$NOPIE_LDFLAGS -Wl,-z,common-page-size=0x4000" \
"" \
{ mbind2a.s mbind2b.c } \
"mbind2a" \
] \
[list \
"Run mbind2b" \
- "-static -Wl,-z,common-page-size=0x4000,-z,max-page-size=0x4000" \
+ "-static -Wl,-z,common-page-size=0x4000" \
"" \
{ mbind2a.s mbind2b.c } \
"mbind2b" \