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 | ||
5b9a7bef KR |
29 | #define OUTPUT_FLAVOR bfd_target_elf_flavour |
30 | ||
bd4d4b8a KR |
31 | #include <bfd.h> |
32 | ||
33 | #define BYTES_IN_WORD 4 /* for now */ | |
5b9a7bef KR |
34 | #include "bfd/libelf.h" |
35 | ||
36 | /* Use this to keep track of .size expressions that involve differences | |
37 | that we can't compute yet. */ | |
38 | #define OBJ_SYMFIELD_TYPE expressionS * | |
bd4d4b8a | 39 | |
c6858c1b ILT |
40 | /* Symbol fields used by the ELF back end. */ |
41 | #define ELF_TARGET_SYMBOL_FIELDS int local:1; unsigned long sy_name_offset; | |
42 | ||
43 | /* Don't change this; change ELF_TARGET_SYMBOL_FIELDS instead. */ | |
44 | #define TARGET_SYMBOL_FIELDS ELF_TARGET_SYMBOL_FIELDS | |
bd4d4b8a | 45 | |
bd4d4b8a KR |
46 | #include "targ-cpu.h" |
47 | ||
48 | #ifndef FALSE | |
49 | #define FALSE 0 | |
50 | #define TRUE !FALSE | |
51 | #endif | |
52 | ||
53 | /* should be conditional on address size! */ | |
6a54ad63 | 54 | #define elf_symbol(asymbol) ((elf_symbol_type *)(&(asymbol)->the_bfd)) |
bd4d4b8a | 55 | |
80903ca6 | 56 | #define S_GET_SIZE(S) (elf_symbol ((S)->bsym)->internal_elf_sym.st_size) |
58d4951d ILT |
57 | #define S_SET_SIZE(S,V) \ |
58 | (elf_symbol((S)->bsym)->internal_elf_sym.st_size = (V)) | |
bd4d4b8a | 59 | |
6f89cd42 KH |
60 | #define S_GET_ALIGN(S) (elf_symbol ((S)->bsym)->internal_elf_sym.st_value) |
61 | #define S_SET_ALIGN(S,V) \ | |
62 | (elf_symbol ((S)->bsym)->internal_elf_sym.st_value = (V)) | |
63 | ||
bd4d4b8a KR |
64 | extern asection *gdb_section; |
65 | ||
bd4d4b8a KR |
66 | #define obj_frob_file() elf_frob_file() |
67 | ||
bd4d4b8a KR |
68 | extern void elf_frob_file PARAMS ((void)); |
69 | extern void elf_file_symbol PARAMS ((char *)); | |
5b9a7bef | 70 | #define obj_app_file elf_file_symbol |
bd4d4b8a | 71 | |
6a54ad63 | 72 | extern void obj_elf_section PARAMS ((int)); |
80903ca6 | 73 | extern void obj_elf_previous PARAMS ((int)); |
c6858c1b | 74 | extern void obj_elf_version PARAMS ((int)); |
80903ca6 | 75 | |
6f89cd42 KH |
76 | /* BFD wants to write the udata field, which is a no-no for the |
77 | globally defined sections. */ | |
78 | #define obj_sec_sym_ok_for_reloc(SEC) ((SEC)->owner != 0) | |
79 | ||
9a36b83f KR |
80 | /* When setting one symbol equal to another, by default we probably |
81 | want them to have the same "size", whatever it means in the current | |
82 | context. */ | |
83 | #define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST,SRC) \ | |
84 | S_SET_SIZE ((DEST), S_GET_SIZE (SRC)) | |
85 | ||
80903ca6 | 86 | /* Stabs go in a separate section. */ |
e51a3912 | 87 | #define SEPARATE_STAB_SECTIONS 1 |
80903ca6 ILT |
88 | |
89 | /* We need 12 bytes at the start of the section to hold some initial | |
90 | information. */ | |
c6858c1b ILT |
91 | extern void obj_elf_init_stab_section PARAMS ((segT)); |
92 | #define INIT_STAB_SECTION(seg) obj_elf_init_stab_section (seg) | |
93 | ||
94 | /* For now, always set ECOFF_DEBUGGING for a MIPS target. */ | |
95 | #ifdef TC_MIPS | |
5b9a7bef | 96 | #define ECOFF_DEBUGGING 1 |
c6858c1b ILT |
97 | #endif |
98 | ||
5b9a7bef | 99 | #if ECOFF_DEBUGGING |
c6858c1b ILT |
100 | |
101 | /* If we are generating ECOFF debugging information, we need some | |
102 | additional fields for each symbol. */ | |
103 | #undef TARGET_SYMBOL_FIELDS | |
104 | #define TARGET_SYMBOL_FIELDS \ | |
105 | ELF_TARGET_SYMBOL_FIELDS \ | |
106 | struct efdr *ecoff_file; \ | |
107 | struct localsym *ecoff_symbol; \ | |
6f89cd42 | 108 | valueT ecoff_extern_size; |
c6858c1b ILT |
109 | |
110 | /* We smuggle stabs in ECOFF rather than using a separate section. | |
111 | The Irix linker can not handle a separate stabs section. */ | |
112 | #undef SEPARATE_STAB_SECTIONS | |
113 | #undef INIT_STAB_SECTION | |
5b9a7bef | 114 | #define OBJ_PROCESS_STAB(seg, what, string, type, other, desc) \ |
c6858c1b ILT |
115 | ecoff_stab ((what), (string), (type), (other), (desc)) |
116 | ||
ad14517d KH |
117 | #define OBJ_GENERATE_ASM_LINENO(filename, lineno) \ |
118 | ecoff_generate_asm_lineno ((filename), (lineno)) | |
6f89cd42 | 119 | |
c6858c1b | 120 | #endif /* ECOFF_DEBUGGING */ |
6a54ad63 | 121 | |
5b9a7bef KR |
122 | extern void elf_frob_symbol PARAMS ((struct symbol *)); |
123 | #define obj_frob_symbol(symp, punt) elf_frob_symbol (symp) | |
124 | ||
bd4d4b8a | 125 | #endif /* _OBJ_ELF_H */ |