-#ifndef XSHAL_ABI
-#define XSHAL_ABI 0
+#ifndef XTHAL_ABI_UNDEFINED
+#define XTHAL_ABI_UNDEFINED -1
+#endif
+
+#ifndef XTHAL_ABI_WINDOWED
+#define XTHAL_ABI_WINDOWED 0
+#endif
+
+#ifndef XTHAL_ABI_CALL0
+#define XTHAL_ABI_CALL0 1
static bfd_vma xtensa_page_power = 12; /* 4K pages. */
/* To force a page break between literals and text, change
static bfd_vma xtensa_page_power = 12; /* 4K pages. */
/* To force a page break between literals and text, change
replace_insn_sec_with_prop_sec (bfd *abfd,
const char *insn_sec_name,
const char *prop_sec_name,
replace_insn_sec_with_prop_sec (bfd *abfd,
const char *insn_sec_name,
const char *prop_sec_name,
entry_count = insn_sec->size / 8;
prop_sec = bfd_get_section_by_name (abfd, prop_sec_name);
if (prop_sec != NULL && insn_sec != NULL)
{
*error_message = _("file already has property tables");
entry_count = insn_sec->size / 8;
prop_sec = bfd_get_section_by_name (abfd, prop_sec_name);
if (prop_sec != NULL && insn_sec != NULL)
{
*error_message = _("file already has property tables");
- _bfd_elf_link_read_relocs (abfd, insn_sec, NULL, NULL, FALSE);
+ _bfd_elf_link_read_relocs (abfd, insn_sec, NULL, NULL, false);
check_xtensa_info (bfd *abfd, asection *info_sec)
{
char *data, *errmsg = "";
check_xtensa_info (bfd *abfd, asection *info_sec)
{
char *data, *errmsg = "";
data = xmalloc (info_sec->size);
if (! bfd_get_section_contents (abfd, info_sec, data, 0, info_sec->size))
data = xmalloc (info_sec->size);
if (! bfd_get_section_contents (abfd, info_sec, data, 0, info_sec->size))
/* Check that the output endianness matches the Xtensa
configuration. The BFD library always includes both big and
/* Check that the output endianness matches the Xtensa
configuration. The BFD library always includes both big and
(bfd *, asection *, struct bfd_link_info *, deps_callback_t, void *);
static void xtensa_ldlang_clear_addresses (lang_statement_union_type *);
(bfd *, asection *, struct bfd_link_info *, deps_callback_t, void *);
static void xtensa_ldlang_clear_addresses (lang_statement_union_type *);
(lang_statement_union_type *, const reloc_deps_graph *);
static bfd_vma ld_assign_relative_paged_dot
(bfd_vma, lang_statement_union_type *, const reloc_deps_graph *,
(lang_statement_union_type *, const reloc_deps_graph *);
static bfd_vma ld_assign_relative_paged_dot
(bfd_vma, lang_statement_union_type *, const reloc_deps_graph *,
- (bfd_vma, lang_statement_union_type *, reloc_deps_graph *, bfd_boolean);
+ (bfd_vma, lang_statement_union_type *, reloc_deps_graph *, bool);
section_is_source (const reloc_deps_graph *deps ATTRIBUTE_UNUSED,
lang_statement_union_type *s)
{
section_is_source (const reloc_deps_graph *deps ATTRIBUTE_UNUSED,
lang_statement_union_type *s)
{
sec = s->input_section.section;
sec_deps = xtensa_get_section_deps (deps, sec);
sec = s->input_section.section;
sec_deps = xtensa_get_section_deps (deps, sec);
section_is_target (const reloc_deps_graph *deps ATTRIBUTE_UNUSED,
lang_statement_union_type *s)
{
section_is_target (const reloc_deps_graph *deps ATTRIBUTE_UNUSED,
lang_statement_union_type *s)
{
sec = s->input_section.section;
sec_deps = xtensa_get_section_deps (deps, sec);
sec = s->input_section.section;
sec_deps = xtensa_get_section_deps (deps, sec);
section_is_source_or_target (const reloc_deps_graph *deps ATTRIBUTE_UNUSED,
lang_statement_union_type *s)
{
section_is_source_or_target (const reloc_deps_graph *deps ATTRIBUTE_UNUSED,
lang_statement_union_type *s)
{
iter_stack_push (xtensa_ld_iter_stack **stack_p,
lang_statement_union_type *parent)
{
iter_stack_push (xtensa_ld_iter_stack **stack_p,
lang_statement_union_type *parent)
{
stack = xmalloc (sizeof (xtensa_ld_iter_stack));
memset (stack, 0, sizeof (xtensa_ld_iter_stack));
stack = xmalloc (sizeof (xtensa_ld_iter_stack));
memset (stack, 0, sizeof (xtensa_ld_iter_stack));
case lang_assignment_statement_enum:
/* Any assignment statement should block reordering across it. */
front_p = NULL;
case lang_assignment_statement_enum:
/* Any assignment statement should block reordering across it. */
front_p = NULL;
current_p = ¤t;
iter_stack_copy_current (stack_p, current_p);
is_target = (section_is_target (deps, l)
current_p = ¤t;
iter_stack_copy_current (stack_p, current_p);
is_target = (section_is_target (deps, l)
deps_has_sec_edge (const reloc_deps_graph *deps, asection *src, asection *tgt)
{
const reloc_deps_section *sec_deps;
deps_has_sec_edge (const reloc_deps_graph *deps, asection *src, asection *tgt)
{
const reloc_deps_section *sec_deps;
deps_has_edge (const reloc_deps_graph *deps,
lang_statement_union_type *src,
lang_statement_union_type *tgt)
{
if (!section_is_source (deps, src))
deps_has_edge (const reloc_deps_graph *deps,
lang_statement_union_type *src,
lang_statement_union_type *tgt)
{
if (!section_is_source (deps, src))
return deps_has_sec_edge (deps, src->input_section.section,
tgt->input_section.section);
return deps_has_sec_edge (deps, src->input_section.section,
tgt->input_section.section);
/* Check if a particular section is included in the link. This will only
be true for one instance of a particular linkonce section. */
/* Check if a particular section is included in the link. This will only
be true for one instance of a particular linkonce section. */
{
if ((statement->header.type == lang_input_section_enum
&& (statement->input_section.section == input_section_target)))
{
if ((statement->header.type == lang_input_section_enum
&& (statement->input_section.section == input_section_target)))
input_section_target = sec;
lang_for_each_statement_worker (input_section_linked_worker, stat_ptr->head);
return input_section_found;
input_section_target = sec;
lang_for_each_statement_worker (input_section_linked_worker, stat_ptr->head);
return input_section_found;
if ((bfd_section_flags (sec) & SEC_LINK_ONCE) == 0
|| strncmp (sec_name, ".gnu.linkonce.", linkonce_len) != 0)
if ((bfd_section_flags (sec) & SEC_LINK_ONCE) == 0
|| strncmp (sec_name, ".gnu.linkonce.", linkonce_len) != 0)
/* Check if this is an Xtensa property section or an exception table
for Tensilica's XCC compiler. */
name = sec_name + linkonce_len;
/* Check if this is an Xtensa property section or an exception table
for Tensilica's XCC compiler. */
name = sec_name + linkonce_len;
name = strchr (name + 5, '.') ? strchr (name + 5, '.') + 1 : name + 5;
else if (name[1] == '.'
&& (name[0] == 'p' || name[0] == 'e' || name[0] == 'h'))
name = strchr (name + 5, '.') ? strchr (name + 5, '.') + 1 : name + 5;
else if (name[1] == '.'
&& (name[0] == 'p' || name[0] == 'e' || name[0] == 'h'))
/* If it has 0 or 1 section bound, then do not reorder. */
if (w->children.head == NULL
|| (w->children.head->header.type == lang_input_section_enum
&& w->children.head->header.next == NULL))
/* If it has 0 or 1 section bound, then do not reorder. */
if (w->children.head == NULL
|| (w->children.head->header.type == lang_input_section_enum
&& w->children.head->header.next == NULL))
&& ((strcmp (".init", l->spec.name) == 0)
|| (strcmp (".fini", l->spec.name) == 0)))
{
&& ((strcmp (".init", l->spec.name) == 0)
|| (strcmp (".fini", l->spec.name) == 0)))
{
literal_wild.header.next = NULL;
literal_wild.header.type = lang_wild_statement_enum;
literal_wild.filename = NULL;
literal_wild.header.next = NULL;
literal_wild.header.type = lang_wild_statement_enum;
literal_wild.filename = NULL;
while (literal_wild.children.head != NULL)
{
lang_statement_union_type *lit = literal_wild.children.head;
while (literal_wild.children.head != NULL)
{
lang_statement_union_type *lit = literal_wild.children.head;
ld_assign_relative_paged_dot (bfd_vma dot,
lang_statement_union_type *s,
const reloc_deps_graph *deps ATTRIBUTE_UNUSED,
ld_assign_relative_paged_dot (bfd_vma dot,
lang_statement_union_type *s,
const reloc_deps_graph *deps ATTRIBUTE_UNUSED,
for (iter_stack_create (stack_p, s);
!iter_stack_empty (stack_p);
for (iter_stack_create (stack_p, s);
!iter_stack_empty (stack_p);
- bfd_boolean sec_is_target = section_is_target (deps, l);
- bfd_boolean sec_is_source = section_is_source (deps, l);
+ bool sec_is_target = section_is_target (deps, l);
+ bool sec_is_source = section_is_source (deps, l);
ld_local_file_relocations_fit (lang_statement_union_type *statement,
const reloc_deps_graph *deps ATTRIBUTE_UNUSED)
{
ld_local_file_relocations_fit (lang_statement_union_type *statement,
const reloc_deps_graph *deps ATTRIBUTE_UNUSED)
{
fprintf (stderr, "Warning: "
"l32r target section before l32r\n");
fflush (stderr);
fprintf (stderr, "Warning: "
"l32r target section before l32r\n");
fflush (stderr);
ld_xtensa_insert_page_offsets (bfd_vma dot,
lang_statement_union_type *s,
reloc_deps_graph *deps,
ld_xtensa_insert_page_offsets (bfd_vma dot,
lang_statement_union_type *s,
reloc_deps_graph *deps,
for (iter_stack_create (stack_p, s);
!iter_stack_empty (stack_p);
for (iter_stack_create (stack_p, s);
!iter_stack_empty (stack_p);
|| (in_literals && !section_is_target (deps, l))
|| (!in_literals && section_is_target (deps, l))))
{
|| (in_literals && !section_is_target (deps, l))
|| (!in_literals && section_is_target (deps, l))))
{
etree_type *name_op = exp_nameop (NAME, ".");
etree_type *addend_op = exp_intop (1 << xtensa_page_power);
etree_type *add_op = exp_binop ('+', name_op, addend_op);
etree_type *name_op = exp_nameop (NAME, ".");
etree_type *addend_op = exp_intop (1 << xtensa_page_power);
etree_type *add_op = exp_binop ('+', name_op, addend_op);
#define OPTION_OPT_SIZEOPT (300)
#define OPTION_LITERAL_MOVEMENT (OPTION_OPT_SIZEOPT + 1)
#define OPTION_NO_LITERAL_MOVEMENT (OPTION_LITERAL_MOVEMENT + 1)
#define OPTION_OPT_SIZEOPT (300)
#define OPTION_LITERAL_MOVEMENT (OPTION_OPT_SIZEOPT + 1)
#define OPTION_NO_LITERAL_MOVEMENT (OPTION_LITERAL_MOVEMENT + 1)
'
PARSE_AND_LIST_LONGOPTS='
{ "size-opt", no_argument, NULL, OPTION_OPT_SIZEOPT},
{ "literal-movement", no_argument, NULL, OPTION_LITERAL_MOVEMENT},
{ "no-literal-movement", no_argument, NULL, OPTION_NO_LITERAL_MOVEMENT},
'
PARSE_AND_LIST_LONGOPTS='
{ "size-opt", no_argument, NULL, OPTION_OPT_SIZEOPT},
{ "literal-movement", no_argument, NULL, OPTION_LITERAL_MOVEMENT},
{ "no-literal-movement", no_argument, NULL, OPTION_NO_LITERAL_MOVEMENT},
+ { "abi-windowed", no_argument, NULL, OPTION_ABI_WINDOWED},
+ { "abi-call0", no_argument, NULL, OPTION_ABI_CALL0},
'
PARSE_AND_LIST_OPTIONS='
fprintf (file, _("\
--size-opt When relaxing longcalls, prefer size\n\
optimization over branch target alignment\n"));
'
PARSE_AND_LIST_OPTIONS='
fprintf (file, _("\
--size-opt When relaxing longcalls, prefer size\n\
optimization over branch target alignment\n"));