# This file is sourced from elf32.em, and defines extra xtensa-elf
# specific routines.
#
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
#include <xtensa-config.h>
#include "../bfd/elf-bfd.h"
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Rela *internal_relocs = NULL;
unsigned reloc_count;
-
+
*error_message = "";
insn_sec = bfd_get_section_by_name (abfd, insn_sec_name);
if (insn_sec == NULL)
*error_message = _("file already has property tables");
return FALSE;
}
-
+
if (insn_sec->size != 0)
{
insn_contents = (bfd_byte *) bfd_malloc (insn_sec->size);
*error_message = _("could not create new section");
goto cleanup;
}
-
+
prop_sec->size = entry_count * 12;
prop_contents = (bfd_byte *) bfd_zalloc (abfd, prop_sec->size);
elf_section_data (prop_sec)->this_hdr.contents = prop_contents;
the number of relocations since it does not use reloc_count. */
elf_section_data (prop_sec)->rel_hdr.sh_entsize =
sizeof (Elf32_External_Rela);
- elf_section_data (prop_sec)->rel_hdr.sh_size =
+ elf_section_data (prop_sec)->rel_hdr.sh_size =
elf_section_data (insn_sec)->rel_hdr.sh_size;
if (prop_contents == NULL && prop_sec->size != 0)
/* If there is already an internal_reloc, then save it so that the
read_relocs function freshly allocates a copy. */
Elf_Internal_Rela *saved_relocs = elf_section_data (insn_sec)->relocs;
-
+
elf_section_data (insn_sec)->relocs = NULL;
- internal_relocs =
+ internal_relocs =
_bfd_elf_link_read_relocs (abfd, insn_sec, NULL, NULL, FALSE);
elf_section_data (insn_sec)->relocs = saved_relocs;
-
+
if (internal_relocs == NULL)
{
*error_message = _("out of memory");
elf_section_data (prop_sec)->relocs = internal_relocs;
prop_sec->reloc_count = reloc_count;
}
-
+
/* Now copy each insn table entry to the prop table entry with
appropriate flags. */
for (entry = 0; entry < entry_count; ++entry)
rela = &internal_relocs[i];
- /* If this relocation is to the .xt.insn section,
+ /* If this relocation is to the .xt.insn section,
change the section number and the offset. */
r_offset = rela->r_offset;
r_offset += 4 * (r_offset / 8);
}
remove_section (abfd, insn_sec);
-
+
if (insn_contents)
free (insn_contents);
-
+
return TRUE;
cleanup:
char *prop_sec_name = NULL;
char *owned_prop_sec_name = NULL;
const char *sec_name;
-
+
sec_name = bfd_get_section_name (abfd, sec);
if (strcmp (sec_name, INSN_SEC_BASE_NAME) == 0)
{
{
/* First call the ELF version. */
gld${EMULATION_NAME}_after_open ();
-
+
/* Now search the input files looking for instruction table sections. */
LANG_FOR_EACH_INPUT_STATEMENT (f)
{
'
PARSE_AND_LIST_OPTIONS='
- fprintf (file, _(" --size-opt\t\tWhen relaxing longcalls, prefer size optimization\n\t\t\t over branch target alignment\n"));
- fprintf (file, _(" --no-relax\t\tDo not relax branches or coalesce literals\n"));
+ fprintf (file, _("\
+ --size-opt When relaxing longcalls, prefer size\n\
+ optimization over branch target alignment\n"));
+ fprintf (file, _("\
+ --no-relax Do not relax branches or coalesce literals\n"));
'
PARSE_AND_LIST_ARGS_CASES='
LDEMUL_AFTER_OPEN=elf_xtensa_after_open
LDEMUL_CHOOSE_TARGET=elf_xtensa_choose_target
LDEMUL_BEFORE_ALLOCATION=elf_xtensa_before_allocation
-