/* BFD back-end for Intel 960 b.out binaries.
- Copyright 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+ 2000
+ Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
#include "aout/stab_gnu.h"
#include "libaout.h" /* BFD a.out internal data structures */
-
static int aligncode PARAMS ((bfd *abfd, asection *input_section,
arelent *r, unsigned int shrink));
static void perform_slip PARAMS ((bfd *abfd, unsigned int slip,
{
struct external_exec *bytes = (struct external_exec *)raw_bytes;
- /* Now fill in fields in the raw data, from the fields in the exec struct. */
+ /* Now fill in fields in the raw data, from the fields in the exec struct. */
bfd_h_put_32 (abfd, execp->a_info , bytes->e_info);
PUT_WORD (abfd, execp->a_text , bytes->e_text);
PUT_WORD (abfd, execp->a_data , bytes->e_data);
bytes->e_relaxable[0] = execp->a_relaxable;
}
-
static const bfd_target *
b_out_object_p (abfd)
bfd *abfd;
return aout_32_some_aout_object_p (abfd, &anexec, b_out_callback);
}
-
/* Finish up the opening of a b.out file for reading. Fill in all the
fields that are not handled by common code. */
obj_textsec (abfd)->rel_filepos = N_TROFF(*execp);
obj_datasec (abfd)->rel_filepos = N_DROFF(*execp);
- adata(abfd).page_size = 1; /* Not applicable. */
- adata(abfd).segment_size = 1; /* Not applicable. */
+ adata(abfd).page_size = 1; /* Not applicable. */
+ adata(abfd).segment_size = 1; /* Not applicable. */
adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
if (execp->a_relaxable)
}
if (q > outsyms)
- qsort (outsyms, q - outsyms, sizeof(asymbol*), b_out_symbol_cmp);
+ qsort (outsyms, q - outsyms, sizeof (asymbol*), b_out_symbol_cmp);
/* Back to your regularly scheduled program. */
- if (bfd_seek (abfd, (file_ptr)(N_SYMOFF(*exec_hdr(abfd))), SEEK_SET)
+ if (bfd_seek (abfd, (file_ptr) (N_SYMOFF(*exec_hdr(abfd))), SEEK_SET)
!= 0)
return false;
if (! aout_32_write_syms (abfd))
return false;
- if (bfd_seek (abfd, (file_ptr)(N_TROFF(*exec_hdr(abfd))), SEEK_SET) != 0)
+ if (bfd_seek (abfd, (file_ptr) (N_TROFF(*exec_hdr(abfd))), SEEK_SET) != 0)
return false;
if (!b_out_squirt_out_relocs (abfd, obj_textsec (abfd))) return false;
- if (bfd_seek (abfd, (file_ptr)(N_DROFF(*exec_hdr(abfd))), SEEK_SET)
+ if (bfd_seek (abfd, (file_ptr) (N_DROFF(*exec_hdr(abfd))), SEEK_SET)
!= 0)
return false;
#define CALL 0x09000000
#define PCREL13_MASK 0x1fff
-
#define output_addr(sec) ((sec)->output_offset+(sec)->output_section->vma)
/* Magic to turn callx into calljx */
word += value + reloc_entry->addend;
- bfd_put_32(abfd, word, dst);
+ bfd_put_32 (abfd, word, dst);
return bfd_reloc_ok;
}
-
/* Magic to turn call into callj */
static bfd_reloc_status_type
callj_callback (abfd, link_info, reloc_entry, data, srcidx, dstidx,
/* The next symbol should be an N_BALNAME. */
BFD_ASSERT(IS_BALNAME(balsym->other));
-
+
/* We are calling a leaf, so replace the call instruction with a
bal. */
word = BAL | ((word
- output_addr (input_section))
& BAL_MASK);
}
- bfd_put_32(abfd, word, (bfd_byte *) data + dstidx);
+ bfd_put_32 (abfd, word, (bfd_byte *) data + dstidx);
return bfd_reloc_ok;
}
static reloc_howto_type howto_reloc_pcrel13 =
HOWTO(PCREL13, 0, 2, 13, true, 0, complain_overflow_signed,0,"pcrel13", true, 0x00001fff,0x00001fff,false);
-
static reloc_howto_type howto_reloc_abs32codeshrunk =
HOWTO(ABS32CODE_SHRUNK, 0, 2, 24, true, 0, complain_overflow_signed, 0,"callx->callj", true, 0x00ffffff, 0x00ffffff,false);
static reloc_howto_type *
b_out_bfd_reloc_type_lookup (abfd, code)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
bfd_reloc_code_real_type code;
{
switch (code)
return false;
doit:
- if (bfd_seek (abfd, (file_ptr)(asect->rel_filepos), SEEK_SET) != 0)
+ if (bfd_seek (abfd, (file_ptr) (asect->rel_filepos), SEEK_SET) != 0)
return false;
count = reloc_size / sizeof (struct relocation_info);
return false;
}
-
-
if (bfd_header_big_endian (abfd)) {
/* big-endian bit field allocation order */
pcrel_mask = 0x80;
}
}
-
if (relocs != NULL)
free (relocs);
asect->relocation = reloc_cache;
asect->reloc_count = count;
-
return true;
}
-
static boolean
b_out_squirt_out_relocs (abfd, section)
bfd *abfd;
if (! aout_32_make_sections (abfd))
return false;
- obj_textsec (abfd)->filepos = sizeof(struct internal_exec);
+ obj_textsec (abfd)->filepos = sizeof (struct internal_exec);
obj_datasec(abfd)->filepos = obj_textsec(abfd)->filepos
+ obj_textsec (abfd)->_raw_size;
static int
b_out_sizeof_headers (ignore_abfd, ignore)
- bfd *ignore_abfd;
- boolean ignore;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
+ boolean ignore ATTRIBUTE_UNUSED;
{
- return sizeof(struct internal_exec);
+ return sizeof (struct internal_exec);
}
-
-
/************************************************************************/
static bfd_vma
get_value (reloc, link_info, input_section)
{
if (! ((*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (symbol),
- input_section->owner, input_section, reloc->address)))
+ input_section->owner, input_section, reloc->address,
+ true)))
abort ();
value = 0;
}
gap = value - (dot - shrink);
-
if (-1<<23 < (long)gap && (long)gap < 1<<23 )
{
/* Change the reloc type from 32bitcode possible 24, to 24bit
break;
default:
- abort();
+ abort ();
}
}
}
#define b_out_bfd_final_link _bfd_generic_final_link
#define b_out_bfd_link_split_section _bfd_generic_link_split_section
#define b_out_bfd_gc_sections bfd_generic_gc_sections
+#define b_out_bfd_merge_sections bfd_generic_merge_sections
#define aout_32_get_section_contents_in_window \
_bfd_generic_get_section_contents_in_window
+extern const bfd_target b_out_vec_little_host;
+
const bfd_target b_out_vec_big_host =
{
"b.out.big", /* name */
BFD_JUMP_TABLE_LINK (b_out),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ & b_out_vec_little_host,
+
(PTR) 0,
};
-
const bfd_target b_out_vec_little_host =
{
"b.out.little", /* name */
BFD_JUMP_TABLE_LINK (b_out),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ & b_out_vec_big_host,
+
(PTR) 0
};