mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2025-01-19 07:24:48 +00:00
Enable --emulation={i386coff,i386elf} for i386 gas.
This commit is contained in:
parent
bcef92fa23
commit
4ca72d3829
@ -1,3 +1,25 @@
|
||||
1999-09-02 Alan Modra <alan@spri.levels.unisa.edu.au>
|
||||
|
||||
* config/obj-multi.h: Include obj-elf.h if OBJ_MAYBE_ELF. Reformat.
|
||||
(obj_frob_file): Test for null pointer.
|
||||
(OBJ_COPY_SYMBOL_ATTRIBUTES): Here too.
|
||||
(OBJ_PROCESS_STAB): And here.
|
||||
(elf_obj_sy): Remove
|
||||
|
||||
* config/obj-elf.h: #ifndef everything defined in obj-multi.h,
|
||||
except OBJ_PROCESS_STAB, which we #undef for ecoff.
|
||||
(elf_obj_sy): Remove #ifndef OBJ_SYMFIELD_TYPE.
|
||||
|
||||
* config/obj-coff.c (no_func): Remove.
|
||||
(coff_format_ops): Change occurrences of no_func to 0, as we test
|
||||
for 0 in obj-multi.h.
|
||||
|
||||
* configure.in: Enable bfd for i386-coff when primary target is
|
||||
bfd. Enable i386 elf,coff emulation support. Don't set
|
||||
USE_EMULATIONS=1 or te_file=multi unless there is more than one
|
||||
emulation to support.
|
||||
*configure: Regenerate.
|
||||
|
||||
1999-09-02 Nick Clifton <nickc@cygnus.com>
|
||||
|
||||
* config/tc-mcore.c (mcore_s_section): Do not dump literals if a
|
||||
|
@ -4445,19 +4445,13 @@ coff_sec_sym_ok_for_reloc (sec)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
no_func ()
|
||||
{
|
||||
abort ();
|
||||
}
|
||||
|
||||
const struct format_ops coff_format_ops =
|
||||
{
|
||||
bfd_target_coff_flavour,
|
||||
0,
|
||||
1,
|
||||
coff_frob_symbol,
|
||||
no_func,
|
||||
0,
|
||||
coff_frob_file_after_relocs,
|
||||
0, 0,
|
||||
0, 0,
|
||||
@ -4465,19 +4459,19 @@ const struct format_ops coff_format_ops =
|
||||
#if 0
|
||||
obj_generate_asm_lineno,
|
||||
#else
|
||||
no_func,
|
||||
0,
|
||||
#endif
|
||||
#if 0
|
||||
obj_stab,
|
||||
#else
|
||||
no_func,
|
||||
0,
|
||||
#endif
|
||||
coff_sec_sym_ok_for_reloc,
|
||||
coff_pop_insert,
|
||||
#if 0
|
||||
obj_set_ext,
|
||||
#else
|
||||
no_func,
|
||||
0,
|
||||
#endif
|
||||
coff_obj_read_begin_hook,
|
||||
coff_obj_symbol_new_hook,
|
||||
|
@ -28,7 +28,9 @@
|
||||
|
||||
#define OBJ_ELF 1
|
||||
|
||||
#ifndef OUTPUT_FLAVOR
|
||||
#define OUTPUT_FLAVOR bfd_target_elf_flavour
|
||||
#endif
|
||||
|
||||
#include <bfd.h>
|
||||
|
||||
@ -52,10 +54,6 @@ extern int alpha_flag_mdebug;
|
||||
#endif /* TC_MIPS */
|
||||
|
||||
/* Additional information we keep for each symbol. */
|
||||
|
||||
/* FIXME: For some reason, this structure is needed both here and in
|
||||
obj-multi.h. */
|
||||
#ifndef OBJ_SYMFIELD_TYPE
|
||||
struct elf_obj_sy
|
||||
{
|
||||
/* Whether the symbol has been marked as local. */
|
||||
@ -76,7 +74,6 @@ struct elf_obj_sy
|
||||
valueT ecoff_extern_size;
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
#define OBJ_SYMFIELD_TYPE struct elf_obj_sy
|
||||
|
||||
@ -91,15 +88,23 @@ extern void elf_begin PARAMS ((void));
|
||||
/* should be conditional on address size! */
|
||||
#define elf_symbol(asymbol) ((elf_symbol_type *)(&(asymbol)->the_bfd))
|
||||
|
||||
#ifndef S_GET_SIZE
|
||||
#define S_GET_SIZE(S) \
|
||||
(elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_size)
|
||||
#endif
|
||||
#ifndef S_SET_SIZE
|
||||
#define S_SET_SIZE(S,V) \
|
||||
(elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_size = (V))
|
||||
#endif
|
||||
|
||||
#ifndef S_GET_ALIGN
|
||||
#define S_GET_ALIGN(S) \
|
||||
(elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_value)
|
||||
#endif
|
||||
#ifndef S_SET_ALIGN
|
||||
#define S_SET_ALIGN(S,V) \
|
||||
(elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_value = (V))
|
||||
#endif
|
||||
|
||||
#define S_GET_OTHER(S) \
|
||||
(elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_other)
|
||||
@ -108,10 +113,14 @@ extern void elf_begin PARAMS ((void));
|
||||
|
||||
extern asection *gdb_section;
|
||||
|
||||
#ifndef obj_frob_file
|
||||
#define obj_frob_file elf_frob_file
|
||||
#endif
|
||||
extern void elf_frob_file PARAMS ((void));
|
||||
|
||||
#ifndef obj_frob_file_after_relocs
|
||||
#define obj_frob_file_after_relocs elf_frob_file_after_relocs
|
||||
#endif
|
||||
extern void elf_frob_file_after_relocs PARAMS ((void));
|
||||
|
||||
#define obj_app_file elf_file_symbol
|
||||
@ -128,11 +137,14 @@ extern void obj_elf_text PARAMS ((int));
|
||||
|
||||
/* BFD wants to write the udata field, which is a no-no for the
|
||||
globally defined sections. */
|
||||
#ifndef obj_sec_sym_ok_for_reloc
|
||||
#define obj_sec_sym_ok_for_reloc(SEC) ((SEC)->owner != 0)
|
||||
#endif
|
||||
|
||||
/* When setting one symbol equal to another, by default we probably
|
||||
want them to have the same "size", whatever it means in the current
|
||||
context. */
|
||||
#ifndef OBJ_COPY_SYMBOL_ATTRIBUTES
|
||||
#define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST,SRC) \
|
||||
do \
|
||||
{ \
|
||||
@ -155,6 +167,7 @@ do \
|
||||
S_SET_OTHER ((DEST), S_GET_OTHER (SRC)); \
|
||||
} \
|
||||
while (0)
|
||||
#endif
|
||||
|
||||
/* Stabs go in a separate section. */
|
||||
#define SEPARATE_STAB_SECTIONS 1
|
||||
@ -175,6 +188,7 @@ extern void obj_elf_init_stab_section PARAMS ((segT));
|
||||
#define INIT_STAB_SECTION(seg) \
|
||||
((void)(ECOFF_DEBUGGING ? 0 : (obj_elf_init_stab_section (seg), 0)))
|
||||
|
||||
#undef OBJ_PROCESS_STAB
|
||||
#define OBJ_PROCESS_STAB(seg, what, string, type, other, desc) \
|
||||
if (ECOFF_DEBUGGING) \
|
||||
ecoff_stab ((seg), (what), (string), (type), (other), (desc))
|
||||
@ -186,7 +200,9 @@ extern void elf_frob_symbol PARAMS ((symbolS *, int *));
|
||||
#endif
|
||||
|
||||
extern void elf_pop_insert PARAMS ((void));
|
||||
#ifndef obj_pop_insert
|
||||
#define obj_pop_insert() elf_pop_insert()
|
||||
#endif
|
||||
|
||||
#ifndef OBJ_MAYBE_ELF
|
||||
#define obj_ecoff_set_ext elf_ecoff_set_ext
|
||||
|
@ -3,42 +3,64 @@
|
||||
#include "emul.h"
|
||||
#include "targ-cpu.h"
|
||||
|
||||
#define OUTPUT_FLAVOR (this_format->flavor)
|
||||
#define obj_frob_symbol(S,P) (this_format->frob_symbol)(S,&(P))
|
||||
#define obj_frob_file (this_format->frob_file)
|
||||
#define obj_frob_file_after_relocs (this_format->frob_file_after_relocs)
|
||||
#define obj_ecoff_set_ext (this_format->ecoff_set_ext)
|
||||
#define obj_pop_insert (this_format->pop_insert)
|
||||
#define obj_read_begin_hook() (this_format->read_begin_hook?this_format->read_begin_hook():(void)0)
|
||||
#define obj_symbol_new_hook (this_format->symbol_new_hook)
|
||||
#define obj_sec_sym_ok_for_reloc (this_format->sec_sym_ok_for_reloc)
|
||||
#define S_GET_SIZE (this_format->s_get_size)
|
||||
#define S_SET_SIZE (this_format->s_set_size)
|
||||
#define S_GET_ALIGN (this_format->s_get_align)
|
||||
#define S_SET_ALIGN (this_format->s_set_align)
|
||||
#define OBJ_COPY_SYMBOL_ATTRIBUTES (this_format->copy_symbol_attributes)
|
||||
#define OBJ_PROCESS_STAB (this_format->process_stab)
|
||||
#define OUTPUT_FLAVOR \
|
||||
(this_format->flavor)
|
||||
|
||||
#define obj_frob_symbol(S,P) \
|
||||
(this_format->frob_symbol) (S, &(P))
|
||||
|
||||
#define obj_frob_file() \
|
||||
(this_format->frob_file \
|
||||
? this_format->frob_file () \
|
||||
: (void) 0)
|
||||
|
||||
#define obj_frob_file_after_relocs \
|
||||
(this_format->frob_file_after_relocs)
|
||||
|
||||
#define obj_ecoff_set_ext \
|
||||
(this_format->ecoff_set_ext)
|
||||
|
||||
#define obj_pop_insert \
|
||||
(this_format->pop_insert)
|
||||
|
||||
#define obj_read_begin_hook() \
|
||||
(this_format->read_begin_hook \
|
||||
? this_format->read_begin_hook () \
|
||||
: (void) 0)
|
||||
|
||||
#define obj_symbol_new_hook \
|
||||
(this_format->symbol_new_hook)
|
||||
|
||||
#define obj_sec_sym_ok_for_reloc \
|
||||
(this_format->sec_sym_ok_for_reloc)
|
||||
|
||||
#define S_GET_SIZE \
|
||||
(this_format->s_get_size)
|
||||
|
||||
#define S_SET_SIZE \
|
||||
(this_format->s_set_size)
|
||||
|
||||
#define S_GET_ALIGN \
|
||||
(this_format->s_get_align)
|
||||
|
||||
#define S_SET_ALIGN \
|
||||
(this_format->s_set_align)
|
||||
|
||||
#define OBJ_COPY_SYMBOL_ATTRIBUTES(d,s) \
|
||||
(this_format->copy_symbol_attributes \
|
||||
? this_format->copy_symbol_attributes (d, s) \
|
||||
: (void) 0)
|
||||
|
||||
#define OBJ_PROCESS_STAB(SEG,W,S,T,O,D) \
|
||||
(this_format->process_stab \
|
||||
? this_format->process_stab (SEG,W,S,T,O,D) \
|
||||
: (void) 0)
|
||||
|
||||
#if defined (OBJ_MAYBE_ECOFF) || (defined (OBJ_MAYBE_ELF) && defined (TC_MIPS))
|
||||
#define ECOFF_DEBUGGING 1
|
||||
#endif
|
||||
|
||||
/* FIXME: What's the story here? Why do we have to define
|
||||
OBJ_SYMFIELD_TYPE both here and in obj-elf.h? */
|
||||
|
||||
#ifdef OBJ_MAYBE_ELF
|
||||
struct elf_obj_sy
|
||||
{
|
||||
int local;
|
||||
expressionS *size;
|
||||
char *versioned_name;
|
||||
#ifdef ECOFF_DEBUGGING
|
||||
/* If we are generating ECOFF debugging information, we need some
|
||||
additional fields for each symbol. */
|
||||
struct efdr *ecoff_file;
|
||||
struct localsym *ecoff_symbol;
|
||||
valueT ecoff_extern_size;
|
||||
#endif
|
||||
};
|
||||
#define OBJ_SYMFIELD_TYPE struct elf_obj_sy
|
||||
/* We need obj-elf for OBJ_SYMFIELD_TYPE so that symbol_get_obj is defined */
|
||||
#include "obj-elf.h"
|
||||
#endif
|
||||
|
934
gas/configure
vendored
934
gas/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -390,6 +390,9 @@ changequote([,])dnl
|
||||
*-elf) bfd_gas=yes ;;
|
||||
*-ecoff) bfd_gas=yes ;;
|
||||
*-som) bfd_gas=yes ;;
|
||||
#enable bfd for coff to allow testing if a bfd target is the primary target,
|
||||
#but not for coff as the primary target
|
||||
i386-coff) if test x${primary_bfd_gas} = xyes; then bfd_gas=yes; fi ;;
|
||||
*) ;;
|
||||
esac
|
||||
|
||||
@ -493,11 +496,12 @@ changequote([,])dnl
|
||||
mips-*-*-elf) case "$endian" in
|
||||
big) emulation="mipsbelf mipslelf mipself" ;;
|
||||
*) emulation="mipslelf mipsbelf mipself" ;;
|
||||
# Uncommenting the next line will turn on support for i386 COFF
|
||||
# in any i386 ELF configuration. This probably doesn't work
|
||||
# correctly.
|
||||
# i386-*-*-elf) emulation="i386coff i386elf" ;;
|
||||
esac ;;
|
||||
i386-*-elf) emulation="i386elf" ;;
|
||||
i386-*-coff) emulation="i386coff" ;;
|
||||
# Uncommenting the next line will turn on support for i386 COFF
|
||||
# in any i386 ELF configuration.
|
||||
# i386-*-*-elf) emulation="i386elf i386coff" ;;
|
||||
esac
|
||||
|
||||
emulations="$emulations $emulation"
|
||||
@ -623,10 +627,16 @@ if test `set . $formats ; shift ; echo $#` -gt 1 ; then
|
||||
obj_format=multi
|
||||
fi
|
||||
if test `set . $emfiles ; shift ; echo $#` -gt 0 ; then
|
||||
te_file=multi
|
||||
extra_objects="$extra_objects $emfiles"
|
||||
DEFAULT_EMULATION=`set . $emulations ; echo $2`
|
||||
AC_DEFINE(USE_EMULATIONS, 1, [Use emulation support?])
|
||||
# e-mips* has more than one emulation per file, e-i386* has just one at the
|
||||
# moment. If only one emulation is specified, then don't define
|
||||
# USE_EMULATIONS or include any of the e-files as they will only be bloat.
|
||||
case "${obj_format}${emfiles}" in
|
||||
multi* | *mips*)
|
||||
te_file=multi
|
||||
extra_objects="$extra_objects $emfiles"
|
||||
AC_DEFINE(USE_EMULATIONS, 1, [Use emulation support?]) ;;
|
||||
esac
|
||||
fi
|
||||
AC_SUBST(extra_objects)
|
||||
AC_DEFINE_UNQUOTED(EMULATIONS, $EMULATIONS, [Supported emulations.])
|
||||
|
Loading…
x
Reference in New Issue
Block a user