diff options
author | Roland McGrath <roland@gnu.org> | 2007-07-19 19:56:10 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2007-07-19 19:56:10 +0000 |
commit | 92b93329b58c744ea269b50f6278ed99416941a9 (patch) | |
tree | 415eaf8c24ce53fd9cdab8ed6af4f5cd6fdd1ede /ld/emultempl/xtensaelf.em | |
parent | 6b33789f617a22563c87282673aa23d9b8b4a3ca (diff) | |
download | gdb-92b93329b58c744ea269b50f6278ed99416941a9.zip gdb-92b93329b58c744ea269b50f6278ed99416941a9.tar.gz gdb-92b93329b58c744ea269b50f6278ed99416941a9.tar.bz2 |
2007-07-19 Roland McGrath <roland@redhat.com>
* genscripts.sh (source_em, fragment): New sh functions.
Truncate e${EMULATION_NAME}.c file before .em script fills it.
Use source_em in place of . for the .em script.
* emultempl/generic.em: Use fragment and source_em functions.
* emultempl/aix.em: Likewise.
* emultempl/alphaelf.em: Likewise.
* emultempl/armcoff.em: Likewise.
* emultempl/armelf.em: Likewise.
* emultempl/avrelf.em: Likewise.
* emultempl/beos.em: Likewise.
* emultempl/cr16elf.em: Likewise.
* emultempl/crxelf.em: Likewise.
* emultempl/elf-generic.em: Likewise.
* emultempl/elf32.em: Likewise.
* emultempl/genelf.em: Likewise.
* emultempl/gld960.em: Likewise.
* emultempl/gld960c.em: Likewise.
* emultempl/hppaelf.em: Likewise.
* emultempl/ia64elf.em: Likewise.
* emultempl/irix.em: Likewise.
* emultempl/linux.em: Likewise.
* emultempl/lnk960.em: Likewise.
* emultempl/m68hc1xelf.em: Likewise.
* emultempl/m68kcoff.em: Likewise.
* emultempl/m68kelf.em: Likewise.
* emultempl/mipsecoff.em: Likewise.
* emultempl/mipself.em: Likewise.
* emultempl/mmix-elfnmmo.em: Likewise.
* emultempl/mmixelf.em: Likewise.
* emultempl/mmo.em: Likewise.
* emultempl/needrelax.em: Likewise.
* emultempl/netbsd.em: Likewise.
* emultempl/pe.em: Likewise.
* emultempl/pep.em: Likewise.
* emultempl/ppc32elf.em: Likewise.
* emultempl/ppc64elf.em: Likewise.
* emultempl/scoreelf.em: Likewise.
* emultempl/sh64elf.em: Likewise.
* emultempl/spuelf.em: Likewise.
* emultempl/sunos.em: Likewise.
* emultempl/ticoff.em: Likewise.
* emultempl/vanilla.em: Likewise.
* emultempl/vxworks.em: Likewise.
* emultempl/xtensaelf.em: Likewise.
* emultempl/z80.em: Likewise.
Diffstat (limited to 'ld/emultempl/xtensaelf.em')
-rw-r--r-- | ld/emultempl/xtensaelf.em | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em index 04f870a..04406a6 100644 --- a/ld/emultempl/xtensaelf.em +++ b/ld/emultempl/xtensaelf.em @@ -23,7 +23,7 @@ # 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" @@ -104,7 +104,7 @@ replace_insn_sec_with_prop_sec (bfd *abfd, 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) @@ -117,7 +117,7 @@ replace_insn_sec_with_prop_sec (bfd *abfd, *error_message = _("file already has property tables"); return FALSE; } - + if (insn_sec->size != 0) { insn_contents = (bfd_byte *) bfd_malloc (insn_sec->size); @@ -144,7 +144,7 @@ replace_insn_sec_with_prop_sec (bfd *abfd, *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; @@ -153,7 +153,7 @@ replace_insn_sec_with_prop_sec (bfd *abfd, 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) @@ -169,12 +169,12 @@ replace_insn_sec_with_prop_sec (bfd *abfd, /* 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"); @@ -188,7 +188,7 @@ replace_insn_sec_with_prop_sec (bfd *abfd, 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) @@ -218,7 +218,7 @@ replace_insn_sec_with_prop_sec (bfd *abfd, 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); @@ -227,10 +227,10 @@ replace_insn_sec_with_prop_sec (bfd *abfd, } remove_section (abfd, insn_sec); - + if (insn_contents) free (insn_contents); - + return TRUE; cleanup: @@ -258,7 +258,7 @@ replace_instruction_table_sections (bfd *abfd, asection *sec) 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) { @@ -297,7 +297,7 @@ elf_xtensa_after_open (void) { /* 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) { @@ -2024,4 +2024,3 @@ LDEMUL_BEFORE_PARSE=elf_xtensa_before_parse LDEMUL_AFTER_OPEN=elf_xtensa_after_open LDEMUL_CHOOSE_TARGET=elf_xtensa_choose_target LDEMUL_BEFORE_ALLOCATION=elf_xtensa_before_allocation - |