1254721Semaste/* Motorola MCore support for BFD.
2254721Semaste   Copyright (C) 1999-2022 Free Software Foundation, Inc.
3254721Semaste
4254721Semaste   This file is part of BFD, the Binary File Descriptor library.
5254721Semaste
6254721Semaste   This program is free software; you can redistribute it and/or modify
7254721Semaste   it under the terms of the GNU General Public License as published by
8254721Semaste   the Free Software Foundation; either version 3 of the License, or
9254721Semaste   (at your option) any later version.
10254721Semaste
11254721Semaste   This program is distributed in the hope that it will be useful,
12254721Semaste   but WITHOUT ANY WARRANTY; without even the implied warranty of
13254721Semaste   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14254721Semaste   GNU General Public License for more details.
15254721Semaste
16254721Semaste   You should have received a copy of the GNU General Public License
17254721Semaste   along with this program; if not, write to the Free Software
18254721Semaste   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19254721Semaste   MA 02110-1301, USA.  */
20254721Semaste
21254721Semaste/* This file holds definitions specific to the MCore COFF/PE ABI. */
22254721Semaste
23254721Semaste#ifndef _COFF_MORE_H
24254721Semaste#define _COFF_MORE_H
25254721Semaste
26254721Semaste#define INCLUDE_COMDAT_FIELDS_IN_AUXENT
27254721Semaste#define L_LNNO_SIZE 2
28254721Semaste#include "coff/external.h"
29254721Semaste
30254721Semaste#define	MCOREMAGIC	0xb00  /* I just made this up */
31254721Semaste
32254721Semaste#define MCOREBADMAG(x) (((x).f_magic != MCOREMAGIC))
33254721Semaste
34254721Semaste#define E_DIMNUM	4	/* # array dimensions in auxiliary entry */
35254721Semaste
36254721Semaste#define IMAGE_REL_MCORE_ABSOLUTE          	0x0000
37254721Semaste#define IMAGE_REL_MCORE_ADDR32            	0x0001
38254721Semaste#define IMAGE_REL_MCORE_PCREL_IMM8BY4		0x0002
39254721Semaste#define IMAGE_REL_MCORE_PCREL_IMM11BY2		0x0003
40254721Semaste#define IMAGE_REL_MCORE_PCREL_IMM4BY2		0x0004
41254721Semaste#define IMAGE_REL_MCORE_PCREL_32		0x0005
42254721Semaste#define IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2	0x0006
43254721Semaste#define IMAGE_REL_MCORE_RVA			0x0007
44254721Semaste
45254721Semaste#define PEMCORE
46254721Semaste
47254721Semaste#define OMAGIC          0404    /* object files, eg as output */
48254721Semaste#define ZMAGIC          0413    /* demand load format, eg normal ld output */
49254721Semaste#define STMAGIC		0401	/* target shlib */
50254721Semaste#define SHMAGIC		0443	/* host   shlib */
51254721Semaste
52254721Semaste/* From winnt.h */
53254721Semaste#define IMAGE_NT_OPTIONAL_HDR_MAGIC        0x10b
54254721Semaste
55254721Semaste/* Define some NT default values. */
56254721Semaste#define NT_SECTION_ALIGNMENT 0x1000
57254721Semaste#define NT_FILE_ALIGNMENT    0x200
58254721Semaste#define NT_DEF_RESERVE       0x100000
59254721Semaste#define NT_DEF_COMMIT        0x1000
60254721Semaste
61254721Semastestruct external_reloc
62254721Semaste{
63254721Semaste  char r_vaddr  [4];
64254721Semaste  char r_symndx [4];
65254721Semaste  char r_type   [2];
66254721Semaste  char r_offset [4];
67254721Semaste};
68254721Semaste
69254721Semaste#define RELOC struct external_reloc
70254721Semaste#define RELSZ 14
71254721Semaste
72254721Semaste#endif /* __COFF_MCORE_H */
73254721Semaste