aboutsummaryrefslogtreecommitdiff
path: root/gas/config/obj-elf.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-01-25 00:26:33 +0000
committerIan Lance Taylor <ian@airs.com>1994-01-25 00:26:33 +0000
commitc6858c1be530dce572993992de026d1f5b3e9af9 (patch)
treea08ae3232fcd21e582381d76b8aeb25e62467c6a /gas/config/obj-elf.h
parent425625680ac18dd85dfdcc3e65ff51f99d8e5e6e (diff)
downloadgdb-c6858c1be530dce572993992de026d1f5b3e9af9.zip
gdb-c6858c1be530dce572993992de026d1f5b3e9af9.tar.gz
gdb-c6858c1be530dce572993992de026d1f5b3e9af9.tar.bz2
* ecoff.c (ecoff_frob_symbol): New function. Put undefined
symbols of known size in the undefined section. Put small common symbols in a .scommon section. * ecoff.h (ecoff_frob_symbol): Declare. * config/obj-ecoff.h (obj_frob_symbol): Define. * config/obj-elf.c (obj_elf_write_symbol_p, obj_elf_write_symbol, obj_elf_frob_symbol): Removed unused functions. * config/obj-elf.h (obj_frob_symbol, obj_write_symbol): Removed unused macros. (obj_elf_frob_symbol, obj_elf_write_symbol): Removed declarations of unused functions. (obj_frob_symbol): Define if ECOFF_DEBUGGING.
Diffstat (limited to 'gas/config/obj-elf.h')
-rw-r--r--gas/config/obj-elf.h57
1 files changed, 36 insertions, 21 deletions
diff --git a/gas/config/obj-elf.h b/gas/config/obj-elf.h
index 7adee97..4af9835 100644
--- a/gas/config/obj-elf.h
+++ b/gas/config/obj-elf.h
@@ -31,7 +31,11 @@
#define BYTES_IN_WORD 4 /* for now */
#include "../bfd/libelf.h"
-#define TARGET_SYMBOL_FIELDS int local:1; unsigned long sy_name_offset;
+/* Symbol fields used by the ELF back end. */
+#define ELF_TARGET_SYMBOL_FIELDS int local:1; unsigned long sy_name_offset;
+
+/* Don't change this; change ELF_TARGET_SYMBOL_FIELDS instead. */
+#define TARGET_SYMBOL_FIELDS ELF_TARGET_SYMBOL_FIELDS
#include "targ-cpu.h"
@@ -49,44 +53,55 @@
extern asection *gdb_section;
-#if 0 /* This should not reference i!!
- If it's really needed, fix it, and the call site if necessary. */
-#define obj_frob_symbol(S,PUNT) if ( obj_elf_frob_symbol (S, &PUNT) ) { i++; continue; }
-#endif
-
/* Copy over the function bit and size of a forwarded symbol. */
#define obj_frob_forward_symbol(sym) \
(((sym)->bsym->flags |= \
((sym)->sy_value.X_add_symbol->bsym->flags & BSF_FUNCTION)), \
S_SET_SIZE ((sym), S_GET_SIZE ((sym)->sy_value.X_add_symbol)))
-#define obj_write_symbol(S) obj_elf_write_symbol (S)
-
#define obj_frob_file() elf_frob_file()
-extern int obj_elf_frob_symbol PARAMS ((struct symbol *, int *));
extern void elf_frob_file PARAMS ((void));
extern void elf_file_symbol PARAMS ((char *));
-extern int obj_elf_write_symbol PARAMS ((struct symbol *));
-
extern void obj_elf_section PARAMS ((int));
extern void obj_elf_previous PARAMS ((int));
+extern void obj_elf_version PARAMS ((int));
/* Stabs go in a separate section. */
#define SEPARATE_STAB_SECTIONS
/* We need 12 bytes at the start of the section to hold some initial
information. */
-#define INIT_STAB_SECTION(seg) (seg_info (seg)->stabu.p = frag_more (12))
-
-/* Set the filename offset. */
-#define OBJ_PROCESS_STAB(seg, string, stroff, type, other, desc) \
- ((type) == N_SO \
- ? (md_number_to_chars (seg_info (seg)->stabu.p, \
- (valueT) (stroff), \
- 4), \
- 0) \
- : 0)
+extern void obj_elf_init_stab_section PARAMS ((segT));
+#define INIT_STAB_SECTION(seg) obj_elf_init_stab_section (seg)
+
+/* For now, always set ECOFF_DEBUGGING for a MIPS target. */
+#ifdef TC_MIPS
+#define ECOFF_DEBUGGING
+#endif
+
+#ifdef ECOFF_DEBUGGING
+
+/* If we are generating ECOFF debugging information, we need some
+ additional fields for each symbol. */
+#undef TARGET_SYMBOL_FIELDS
+#define TARGET_SYMBOL_FIELDS \
+ ELF_TARGET_SYMBOL_FIELDS \
+ struct efdr *ecoff_file; \
+ struct localsym *ecoff_symbol; \
+ char ecoff_undefined;
+
+/* We smuggle stabs in ECOFF rather than using a separate section.
+ The Irix linker can not handle a separate stabs section. */
+#undef SEPARATE_STAB_SECTIONS
+#undef INIT_STAB_SECTION
+#define OBJ_PROCESS_STAB(what, string, type, other, desc) \
+ ecoff_stab ((what), (string), (type), (other), (desc))
+
+/* ECOFF requires that we call the ecoff_frob_symbol hook. */
+#define obj_frob_symbol(symp, punt) ecoff_frob_symbol (symp)
+
+#endif /* ECOFF_DEBUGGING */
#endif /* _OBJ_ELF_H */