- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1998-2019 Free Software Foundation, Inc.
Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
This file is part of BFD, the Binary File Descriptor library.
Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
This file is part of BFD, the Binary File Descriptor library.
-#define TEXT_START_ADDR 1024
-#define TARGET_PAGE_SIZE 128
-#define SEGMENT_SIZE TARGET_PAGE_SIZE
-#define DEFAULT_ARCH bfd_arch_tic30
+#define TEXT_START_ADDR 1024
+#define TARGET_PAGE_SIZE 128
+#define SEGMENT_SIZE TARGET_PAGE_SIZE
+#define DEFAULT_ARCH bfd_arch_tic30
#define MY_reloc_howto(BFD, REL, IN, EX, PC) tic30_aout_reloc_howto (BFD, REL, & IN, & EX, & PC)
#define MY_reloc_howto(BFD, REL, IN, EX, PC) tic30_aout_reloc_howto (BFD, REL, & IN, & EX, & PC)
-#define MY_final_link_relocate tic30_aout_final_link_relocate
-#define MY_object_p tic30_aout_object_p
-#define MY_mkobject NAME (aout,mkobject)
+#define MY_final_link_relocate tic30_aout_final_link_relocate
+#define MY_object_p tic30_aout_object_p
+#define MY_mkobject NAME (aout,mkobject)
return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined;
/* Get the size of the input section and turn it into the TMS320C30
32-bit address format. */
return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined;
/* Get the size of the input section and turn it into the TMS320C30
32-bit address format. */
return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined;
/* Get the size of the input section and turn it into the TMS320C30
32-bit address format. */
return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined;
/* Get the size of the input section and turn it into the TMS320C30
32-bit address format. */
(bfd_get_8 (BFD, ADDR + 2) )
#define bfd_putb_24(BFD,DATA,ADDR) \
(bfd_get_8 (BFD, ADDR + 2) )
#define bfd_putb_24(BFD,DATA,ADDR) \
/* Set parameters about this a.out file that are machine-dependent.
This routine is called from some_aout_object_p just before it returns. */
/* Set parameters about this a.out file that are machine-dependent.
This routine is called from some_aout_object_p just before it returns. */
unsigned long arch_align;
/* Calculate the file positions of the parts of a newly read aout header. */
unsigned long arch_align;
/* Calculate the file positions of the parts of a newly read aout header. */
- obj_textsec (abfd)->vma = N_TXTADDR (*execp);
- obj_datasec (abfd)->vma = N_DATADDR (*execp);
- obj_bsssec (abfd)->vma = N_BSSADDR (*execp);
+ obj_textsec (abfd)->vma = N_TXTADDR (execp);
+ obj_datasec (abfd)->vma = N_DATADDR (execp);
+ obj_bsssec (abfd)->vma = N_BSSADDR (execp);
obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
/* The file offsets of the sections. */
obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
/* The file offsets of the sections. */
- obj_textsec (abfd)->rel_filepos = N_TRELOFF (*execp);
- obj_datasec (abfd)->rel_filepos = N_DRELOFF (*execp);
+ obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
+ obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
execp->a_syms = bfd_get_symcount (abfd) * EXTERNAL_NLIST_SIZE;
execp->a_entry = bfd_get_start_address (abfd);
execp->a_syms = bfd_get_symcount (abfd) * EXTERNAL_NLIST_SIZE;
execp->a_entry = bfd_get_start_address (abfd);
MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
{
struct internal_exec *execp = exec_hdr (abfd);
MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
{
struct internal_exec *execp = exec_hdr (abfd);
- vma = info->create_object_symbols_section->vma;
- pos += vma;
- obj_textsec (abfd)->filepos = pos;
- obj_textsec (abfd)->vma = vma;
- obj_textsec (abfd)->user_set_vma = 1;
- pos += obj_textsec (abfd)->size;
- vma += obj_textsec (abfd)->size;
+ if (obj_textsec (abfd) != NULL)
+ {
+ pos += vma;
+ obj_textsec (abfd)->filepos = pos;
+ obj_textsec (abfd)->vma = vma;
+ obj_textsec (abfd)->user_set_vma = 1;
+ execp->a_text = obj_textsec (abfd)->size;
+ pos += obj_textsec (abfd)->size;
+ vma += obj_textsec (abfd)->size;
+ }
- if (info->create_object_symbols_section->next->vma > 0)
- obj_datasec (abfd)->vma = info->create_object_symbols_section->next->vma;
+ if (abfd->flags & D_PAGED)
+ {
+ if (objsym_section != NULL
+ && objsym_section->next != NULL
+ && objsym_section->next->vma != 0)
+ obj_datasec (abfd)->vma = objsym_section->next->vma;
+ else
+ obj_datasec (abfd)->vma = BFD_ALIGN (vma, adata (abfd).segment_size);
+ }
- obj_datasec (abfd)->vma = BFD_ALIGN (vma, adata (abfd).segment_size);
- }
- else
- obj_datasec (abfd)->vma = BFD_ALIGN (vma, 4);
+ obj_datasec (abfd)->vma = BFD_ALIGN (vma, 4);
- if (obj_datasec (abfd)->vma < vma)
- obj_datasec (abfd)->vma = BFD_ALIGN (vma, 4);
+ if (obj_datasec (abfd)->vma < vma)
+ obj_datasec (abfd)->vma = BFD_ALIGN (vma, 4);
- obj_datasec (abfd)->user_set_vma = 1;
- vma = obj_datasec (abfd)->vma;
- obj_datasec (abfd)->filepos = vma + adata (abfd).exec_bytes_size;
- execp->a_text = vma - obj_textsec (abfd)->vma;
- obj_textsec (abfd)->size = execp->a_text;
+ pos += obj_datasec (abfd)->vma - vma;
+ obj_datasec (abfd)->filepos = pos;
+ obj_datasec (abfd)->user_set_vma = 1;
+
+ vma = obj_datasec (abfd)->vma;
+ if (obj_textsec (abfd) != NULL)
+ {
+ execp->a_text = vma - obj_textsec (abfd)->vma;
+ obj_textsec (abfd)->size = execp->a_text;
+ }
+ execp->a_data = obj_datasec (abfd)->size;
+ vma += obj_datasec (abfd)->size;
+ }
- vma += obj_datasec (abfd)->size;
- pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma;
- obj_datasec (abfd)->size += pad;
- pos += obj_datasec (abfd)->size;
- execp->a_data = obj_datasec (abfd)->size;
+ if (obj_bsssec (abfd) != NULL)
+ {
+ int pad;
+
+ pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma;
+ if (obj_datasec (abfd) != NULL)
+ {
+ obj_datasec (abfd)->size += pad;
+ execp->a_data += pad;
+ }
+ else if (obj_textsec (abfd) != NULL)
+ {
+ obj_textsec (abfd)->size += pad;
+ execp->a_text += pad;
+ }
/* We are fully resized, so don't readjust in final_link. */
adata (abfd).magic = z_magic;
/* We are fully resized, so don't readjust in final_link. */
adata (abfd).magic = z_magic;
#endif
/* No core file defined here -- configure in trad-core.c separately. */
#ifndef MY_core_file_failing_command
#endif
/* No core file defined here -- configure in trad-core.c separately. */
#ifndef MY_core_file_failing_command
#endif
#ifndef MY_core_file_failing_signal
#define MY_core_file_failing_signal _bfd_nocore_core_file_failing_signal
#endif
#ifndef MY_core_file_failing_signal
#define MY_core_file_failing_signal _bfd_nocore_core_file_failing_signal
#ifndef MY_canonicalize_reloc
#define MY_canonicalize_reloc NAME (aout, canonicalize_reloc)
#endif
#ifndef MY_canonicalize_reloc
#define MY_canonicalize_reloc NAME (aout, canonicalize_reloc)
#endif
#ifndef MY_make_empty_symbol
#define MY_make_empty_symbol NAME (aout, make_empty_symbol)
#endif
#ifndef MY_make_empty_symbol
#define MY_make_empty_symbol NAME (aout, make_empty_symbol)
#endif
#ifndef MY_get_symbol_info
#define MY_get_symbol_info NAME (aout, get_symbol_info)
#endif
#ifndef MY_get_symbol_info
#define MY_get_symbol_info NAME (aout, get_symbol_info)
#endif
#ifndef MY_find_nearest_line
#define MY_find_nearest_line NAME (aout, find_nearest_line)
#endif
#ifndef MY_find_nearest_line
#define MY_find_nearest_line NAME (aout, find_nearest_line)
#endif
#ifndef MY_bfd_merge_sections
#define MY_bfd_merge_sections bfd_generic_merge_sections
#endif
#ifndef MY_bfd_is_group_section
#define MY_bfd_is_group_section bfd_generic_is_group_section
#endif
#ifndef MY_bfd_merge_sections
#define MY_bfd_merge_sections bfd_generic_merge_sections
#endif
#ifndef MY_bfd_is_group_section
#define MY_bfd_is_group_section bfd_generic_is_group_section
#endif
#ifndef MY_bfd_define_common_symbol
#define MY_bfd_define_common_symbol bfd_generic_define_common_symbol
#endif
#ifndef MY_bfd_define_common_symbol
#define MY_bfd_define_common_symbol bfd_generic_define_common_symbol
#endif
#ifndef MY_bfd_link_hash_table_create
#define MY_bfd_link_hash_table_create NAME (aout, link_hash_table_create)
#endif
#ifndef MY_bfd_link_hash_table_create
#define MY_bfd_link_hash_table_create NAME (aout, link_hash_table_create)
#endif
#ifndef MY_bfd_link_add_symbols
#define MY_bfd_link_add_symbols NAME (aout, link_add_symbols)
#endif
#ifndef MY_bfd_link_add_symbols
#define MY_bfd_link_add_symbols NAME (aout, link_add_symbols)
#endif
#ifndef MY_bfd_copy_private_bfd_data
#define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
#endif
#ifndef MY_bfd_copy_private_bfd_data
#define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
#endif
MY_symbol_leading_char,
AR_PAD_CHAR, /* AR_pad_char. */
15, /* AR_max_namelen. */
MY_symbol_leading_char,
AR_PAD_CHAR, /* AR_pad_char. */
15, /* AR_max_namelen. */
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Headers. */
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Headers. */
- {_bfd_dummy_target, MY_object_p, /* bfd_check_format. */
- bfd_generic_archive_p, MY_core_file_p},
- {bfd_false, MY_mkobject, /* bfd_set_format. */
- _bfd_generic_mkarchive, bfd_false},
- {bfd_false, MY_write_object_contents, /* bfd_write_contents. */
- _bfd_write_archive_contents, bfd_false},
+ { /* bfd_check_format. */
+ _bfd_dummy_target,
+ MY_object_p,
+ bfd_generic_archive_p,
+ MY_core_file_p
+ },
+ { /* bfd_set_format. */
+ _bfd_bool_bfd_false_error,
+ MY_mkobject,
+ _bfd_generic_mkarchive,
+ _bfd_bool_bfd_false_error
+ },
+ { /* bfd_write_contents. */
+ _bfd_bool_bfd_false_error,
+ MY_write_object_contents,
+ _bfd_write_archive_contents,
+ _bfd_bool_bfd_false_error
+ },
BFD_JUMP_TABLE_GENERIC (MY),
BFD_JUMP_TABLE_COPY (MY),
BFD_JUMP_TABLE_GENERIC (MY),
BFD_JUMP_TABLE_COPY (MY),