]>
Commit | Line | Data |
---|---|---|
bd4d4b8a KR |
1 | /* ELF object file format. |
2 | Copyright (C) 1992, 1993 Free Software Foundation, Inc. | |
3 | ||
4 | This file is part of GAS, the GNU Assembler. | |
5 | ||
6 | GAS is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 1, or (at your option) | |
9 | any later version. | |
10 | ||
11 | GAS is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with GAS; see the file COPYING. If not, write to | |
18 | the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
19 | ||
20 | ||
21 | /* HP PA-RISC support was contributed by the Center for Software Science | |
22 | at the University of Utah. */ | |
23 | ||
24 | #ifndef _OBJ_ELF_H | |
25 | #define _OBJ_ELF_H | |
26 | ||
27 | #define OBJ_ELF 1 | |
28 | ||
29 | #include <bfd.h> | |
30 | ||
31 | #define BYTES_IN_WORD 4 /* for now */ | |
32 | #include "../bfd/libelf.h" | |
33 | ||
c6858c1b ILT |
34 | /* Symbol fields used by the ELF back end. */ |
35 | #define ELF_TARGET_SYMBOL_FIELDS int local:1; unsigned long sy_name_offset; | |
36 | ||
37 | /* Don't change this; change ELF_TARGET_SYMBOL_FIELDS instead. */ | |
38 | #define TARGET_SYMBOL_FIELDS ELF_TARGET_SYMBOL_FIELDS | |
bd4d4b8a | 39 | |
bd4d4b8a KR |
40 | #include "targ-cpu.h" |
41 | ||
42 | #ifndef FALSE | |
43 | #define FALSE 0 | |
44 | #define TRUE !FALSE | |
45 | #endif | |
46 | ||
47 | /* should be conditional on address size! */ | |
6a54ad63 | 48 | #define elf_symbol(asymbol) ((elf_symbol_type *)(&(asymbol)->the_bfd)) |
bd4d4b8a | 49 | |
80903ca6 | 50 | #define S_GET_SIZE(S) (elf_symbol ((S)->bsym)->internal_elf_sym.st_size) |
58d4951d ILT |
51 | #define S_SET_SIZE(S,V) \ |
52 | (elf_symbol((S)->bsym)->internal_elf_sym.st_size = (V)) | |
bd4d4b8a KR |
53 | |
54 | extern asection *gdb_section; | |
55 | ||
80903ca6 ILT |
56 | /* Copy over the function bit and size of a forwarded symbol. */ |
57 | #define obj_frob_forward_symbol(sym) \ | |
58 | (((sym)->bsym->flags |= \ | |
59 | ((sym)->sy_value.X_add_symbol->bsym->flags & BSF_FUNCTION)), \ | |
60 | S_SET_SIZE ((sym), S_GET_SIZE ((sym)->sy_value.X_add_symbol))) | |
61 | ||
bd4d4b8a KR |
62 | #define obj_frob_file() elf_frob_file() |
63 | ||
bd4d4b8a KR |
64 | extern void elf_frob_file PARAMS ((void)); |
65 | extern void elf_file_symbol PARAMS ((char *)); | |
66 | ||
6a54ad63 | 67 | extern void obj_elf_section PARAMS ((int)); |
80903ca6 | 68 | extern void obj_elf_previous PARAMS ((int)); |
c6858c1b | 69 | extern void obj_elf_version PARAMS ((int)); |
80903ca6 ILT |
70 | |
71 | /* Stabs go in a separate section. */ | |
72 | #define SEPARATE_STAB_SECTIONS | |
73 | ||
74 | /* We need 12 bytes at the start of the section to hold some initial | |
75 | information. */ | |
c6858c1b ILT |
76 | extern void obj_elf_init_stab_section PARAMS ((segT)); |
77 | #define INIT_STAB_SECTION(seg) obj_elf_init_stab_section (seg) | |
78 | ||
79 | /* For now, always set ECOFF_DEBUGGING for a MIPS target. */ | |
80 | #ifdef TC_MIPS | |
81 | #define ECOFF_DEBUGGING | |
82 | #endif | |
83 | ||
84 | #ifdef ECOFF_DEBUGGING | |
85 | ||
86 | /* If we are generating ECOFF debugging information, we need some | |
87 | additional fields for each symbol. */ | |
88 | #undef TARGET_SYMBOL_FIELDS | |
89 | #define TARGET_SYMBOL_FIELDS \ | |
90 | ELF_TARGET_SYMBOL_FIELDS \ | |
91 | struct efdr *ecoff_file; \ | |
92 | struct localsym *ecoff_symbol; \ | |
93 | char ecoff_undefined; | |
94 | ||
95 | /* We smuggle stabs in ECOFF rather than using a separate section. | |
96 | The Irix linker can not handle a separate stabs section. */ | |
97 | #undef SEPARATE_STAB_SECTIONS | |
98 | #undef INIT_STAB_SECTION | |
99 | #define OBJ_PROCESS_STAB(what, string, type, other, desc) \ | |
100 | ecoff_stab ((what), (string), (type), (other), (desc)) | |
101 | ||
102 | /* ECOFF requires that we call the ecoff_frob_symbol hook. */ | |
103 | #define obj_frob_symbol(symp, punt) ecoff_frob_symbol (symp) | |
104 | ||
105 | #endif /* ECOFF_DEBUGGING */ | |
6a54ad63 | 106 | |
bd4d4b8a | 107 | #endif /* _OBJ_ELF_H */ |