* ldexp.c (fold_name <MAXPAGESIZE>): Return config.maxpagesize.
(fold_name <COMMONPAGESIZE>): Similarly.
* ldlang.c (output_target): Make global.
* ldlang.h (output_target): Declare.
* ldmain.c (main): Set config.maxpagesize from bfd_emul_get_maxpagesize.
Similarly for config.commonpagesize.
* ldemul.c (set_output_arch_default): Call bfd_emul_set_maxpagesize
and bfd_emul_set_commonpagesize.
* emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Don't call
bfd_emul_set_maxpagesize or bfd_emul_set_commonpagesize here.
+
+ PR ld/10569
+ * ldexp.c (fold_name <MAXPAGESIZE>): Return config.maxpagesize.
+ (fold_name <COMMONPAGESIZE>): Similarly.
+ * ldlang.c (output_target): Make global.
+ * ldlang.h (output_target): Declare.
+ * ldmain.c (main): Set config.maxpagesize from bfd_emul_get_maxpagesize.
+ Similarly for config.commonpagesize.
+ * ldemul.c (set_output_arch_default): Call bfd_emul_set_maxpagesize
+ and bfd_emul_set_commonpagesize.
+ * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Don't call
+ bfd_emul_set_maxpagesize or bfd_emul_set_commonpagesize here.
+
* ldexp.c (exp_intop, exp_bigintop, exp_relop, exp_binop)
if (*end || (config.maxpagesize & (config.maxpagesize - 1)) != 0)
einfo (_("%P%F: invalid maxium page size \`%s'\n"),
optarg + 14);
- ASSERT (default_target != NULL);
- bfd_emul_set_maxpagesize (default_target, config.maxpagesize);
}
else if (CONST_STRNEQ (optarg, "common-page-size="))
{
|| (config.commonpagesize & (config.commonpagesize - 1)) != 0)
einfo (_("%P%F: invalid common page size \`%s'\n"),
optarg + 17);
- ASSERT (default_target != NULL);
- bfd_emul_set_commonpagesize (default_target,
- config.commonpagesize);
}
/* What about the other Solaris -z options? FIXME. */
break;
/* Set the output architecture and machine if possible. */
bfd_set_arch_mach (link_info.output_bfd,
ldfile_output_architecture, ldfile_output_machine);
+
+ bfd_emul_set_maxpagesize (output_target, config.maxpagesize);
+ bfd_emul_set_commonpagesize (output_target, config.commonpagesize);
}
void
case CONSTANT:
if (strcmp (tree->name.name, "MAXPAGESIZE") == 0)
- new_abs (bfd_emul_get_maxpagesize (default_target));
+ new_abs (config.maxpagesize);
else if (strcmp (tree->name.name, "COMMONPAGESIZE") == 0)
- new_abs (bfd_emul_get_commonpagesize (default_target));
+ new_abs (config.commonpagesize);
else
einfo (_("%F%S: unknown constant `%s' referenced in expression\n"),
tree->name.name);
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
static const char *startup_file;
+static const char *entry_symbol_default = "start";
static bfd_boolean placed_commons = FALSE;
static bfd_boolean stripped_excluded_sections = FALSE;
static lang_output_section_statement_type *default_common_section;
static bfd_vma print_dot;
static lang_input_statement_type *first_file;
static const char *current_target;
-static const char *output_target;
static lang_statement_list_type statement_list;
static struct bfd_hash_table lang_definedness_table;
static lang_statement_list_type *stat_save[10];
(struct bfd_elf_version_expr_head *);
/* Exported variables. */
+const char *output_target;
lang_output_section_statement_type *abs_output_section;
lang_statement_list_type lang_output_section_statement;
lang_statement_list_type *stat_ptr = &statement_list;
lang_statement_list_type file_chain = { NULL, NULL };
lang_statement_list_type input_file_chain;
struct bfd_sym_chain entry_symbol = { NULL, NULL };
-static const char *entry_symbol_default = "start";
const char *entry_section = ".text";
bfd_boolean entry_from_cmdline;
bfd_boolean lang_has_input_file = FALSE;
lang_output_section_statement_type **os_tail;
};
+extern const char *output_target;
extern lang_output_section_statement_type *abs_output_section;
extern lang_statement_list_type lang_output_section_statement;
extern bfd_boolean lang_has_input_file;
emulation = get_emulation (argc, argv);
ldemul_choose_mode (emulation);
default_target = ldemul_choose_target (argc, argv);
+ config.maxpagesize = bfd_emul_get_maxpagesize (default_target);
+ config.commonpagesize = bfd_emul_get_commonpagesize (default_target);
lang_init ();
ldemul_before_parse ();
lang_has_input_file = FALSE;