1 /* ELF object file format.
2 Copyright (C) 1992, 1993 Free Software Foundation, Inc.
4 This file is part of GAS, the GNU Assembler.
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)
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.
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. */
21 /* HP PA-RISC support was contributed by the Center for Software Science
22 at the University of Utah. */
31 #define BYTES_IN_WORD 4 /* for now */
32 #include "../bfd/libelf.h"
34 /* Symbol fields used by the ELF back end. */
35 #define ELF_TARGET_SYMBOL_FIELDS int local:1; unsigned long sy_name_offset;
37 /* Don't change this; change ELF_TARGET_SYMBOL_FIELDS instead. */
38 #define TARGET_SYMBOL_FIELDS ELF_TARGET_SYMBOL_FIELDS
47 /* should be conditional on address size! */
48 #define elf_symbol(asymbol) ((elf_symbol_type *)(&(asymbol)->the_bfd))
50 #define S_GET_SIZE(S) (elf_symbol ((S)->bsym)->internal_elf_sym.st_size)
51 #define S_SET_SIZE(S,V) \
52 (elf_symbol((S)->bsym)->internal_elf_sym.st_size = (V))
54 extern asection
*gdb_section
;
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)))
62 #define obj_frob_file() elf_frob_file()
64 extern void elf_frob_file
PARAMS ((void));
65 extern void elf_file_symbol
PARAMS ((char *));
67 extern void obj_elf_section
PARAMS ((int));
68 extern void obj_elf_previous
PARAMS ((int));
69 extern void obj_elf_version
PARAMS ((int));
71 /* Stabs go in a separate section. */
72 #define SEPARATE_STAB_SECTIONS
74 /* We need 12 bytes at the start of the section to hold some initial
76 extern void obj_elf_init_stab_section
PARAMS ((segT
));
77 #define INIT_STAB_SECTION(seg) obj_elf_init_stab_section (seg)
79 /* For now, always set ECOFF_DEBUGGING for a MIPS target. */
81 #define ECOFF_DEBUGGING
84 #ifdef ECOFF_DEBUGGING
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; \
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))
102 /* ECOFF requires that we call the ecoff_frob_symbol hook. */
103 #define obj_frob_symbol(symp, punt) ecoff_frob_symbol (symp)
105 #endif /* ECOFF_DEBUGGING */
107 #endif /* _OBJ_ELF_H */