mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-12 01:24:12 +08:00
ia64-hpux patches from Steve Ellcey.
* config/tc-ia64.c (md_shortopts, md_parse_option, md_show_usage): Change M to m for -milp32 or -mlp64 to match gcc. (dot_endp): Use bytes_per_address instead of 8. (emit_one_bundle): Use number_to_chars_littleendian instead of md_number_to_chars. (fix_insn): Likewise. (ia64_init): New function. (ia64_target_format): New function. (md_begin): Set endianness, arch, and machine as appropriate. * config/tc-ia64.h: (TARGET_BYTES_BIG_ENDIAN, md_number_to_chars): Make these macros depend on TE_HPUX macro. (TARGET_FORMAT): Define. (HOST_SPECIAL_INIT): Define. * config/te-hpux.h: New file. * configure.in: Add "ia64-*-hpux*" target to configure. * configure: Regenerate.
This commit is contained in:
@ -1,3 +1,22 @@
|
|||||||
|
2000-11-06 Steve Ellcey <sje@cup.hp.com>
|
||||||
|
|
||||||
|
* config/tc-ia64.c (md_shortopts, md_parse_option, md_show_usage):
|
||||||
|
Change M to m for -milp32 or -mlp64 to match gcc.
|
||||||
|
(dot_endp): Use bytes_per_address instead of 8.
|
||||||
|
(emit_one_bundle): Use number_to_chars_littleendian instead of
|
||||||
|
md_number_to_chars.
|
||||||
|
(fix_insn): Likewise.
|
||||||
|
(ia64_init): New function.
|
||||||
|
(ia64_target_format): New function.
|
||||||
|
(md_begin): Set endianness, arch, and machine as appropriate.
|
||||||
|
* config/tc-ia64.h: (TARGET_BYTES_BIG_ENDIAN, md_number_to_chars):
|
||||||
|
Make these macros depend on TE_HPUX macro.
|
||||||
|
(TARGET_FORMAT): Define.
|
||||||
|
(HOST_SPECIAL_INIT): Define.
|
||||||
|
* config/te-hpux.h: New file.
|
||||||
|
* configure.in: Add "ia64-*-hpux*" target to configure.
|
||||||
|
* configure: Regenerate.
|
||||||
|
|
||||||
2000-11-06 Kazu Hirata <kazu@hxi.com>
|
2000-11-06 Kazu Hirata <kazu@hxi.com>
|
||||||
|
|
||||||
* as.c: Fix formatting.
|
* as.c: Fix formatting.
|
||||||
|
@ -156,7 +156,7 @@ const char FLT_CHARS[] = "rRsSfFdDxXpP";
|
|||||||
|
|
||||||
/* ia64-specific option processing: */
|
/* ia64-specific option processing: */
|
||||||
|
|
||||||
const char *md_shortopts = "M:N:x::";
|
const char *md_shortopts = "m:N:x::";
|
||||||
|
|
||||||
struct option md_longopts[] =
|
struct option md_longopts[] =
|
||||||
{
|
{
|
||||||
@ -3588,6 +3588,7 @@ dot_endp (dummy)
|
|||||||
{
|
{
|
||||||
expressionS e;
|
expressionS e;
|
||||||
unsigned char *ptr;
|
unsigned char *ptr;
|
||||||
|
int bytes_per_address;
|
||||||
long where;
|
long where;
|
||||||
segT saved_seg;
|
segT saved_seg;
|
||||||
subsegT saved_subseg;
|
subsegT saved_subseg;
|
||||||
@ -3612,19 +3613,20 @@ dot_endp (dummy)
|
|||||||
set_section ((char *) special_section_name[SPECIAL_SECTION_UNWIND]);
|
set_section ((char *) special_section_name[SPECIAL_SECTION_UNWIND]);
|
||||||
ptr = frag_more (24);
|
ptr = frag_more (24);
|
||||||
where = frag_now_fix () - 24;
|
where = frag_now_fix () - 24;
|
||||||
|
bytes_per_address = bfd_arch_bits_per_address (stdoutput) / 8;
|
||||||
|
|
||||||
/* Issue the values of a) Proc Begin, b) Proc End, c) Unwind Record. */
|
/* Issue the values of a) Proc Begin, b) Proc End, c) Unwind Record. */
|
||||||
e.X_op = O_pseudo_fixup;
|
e.X_op = O_pseudo_fixup;
|
||||||
e.X_op_symbol = pseudo_func[FUNC_SEG_RELATIVE].u.sym;
|
e.X_op_symbol = pseudo_func[FUNC_SEG_RELATIVE].u.sym;
|
||||||
e.X_add_number = 0;
|
e.X_add_number = 0;
|
||||||
e.X_add_symbol = unwind.proc_start;
|
e.X_add_symbol = unwind.proc_start;
|
||||||
ia64_cons_fix_new (frag_now, where, 8, &e);
|
ia64_cons_fix_new (frag_now, where, bytes_per_address, &e);
|
||||||
|
|
||||||
e.X_op = O_pseudo_fixup;
|
e.X_op = O_pseudo_fixup;
|
||||||
e.X_op_symbol = pseudo_func[FUNC_SEG_RELATIVE].u.sym;
|
e.X_op_symbol = pseudo_func[FUNC_SEG_RELATIVE].u.sym;
|
||||||
e.X_add_number = 0;
|
e.X_add_number = 0;
|
||||||
e.X_add_symbol = unwind.proc_end;
|
e.X_add_symbol = unwind.proc_end;
|
||||||
ia64_cons_fix_new (frag_now, where + 8, 8, &e);
|
ia64_cons_fix_new (frag_now, where + bytes_per_address, bytes_per_address, &e);
|
||||||
|
|
||||||
if (unwind.info != 0)
|
if (unwind.info != 0)
|
||||||
{
|
{
|
||||||
@ -3632,10 +3634,10 @@ dot_endp (dummy)
|
|||||||
e.X_op_symbol = pseudo_func[FUNC_SEG_RELATIVE].u.sym;
|
e.X_op_symbol = pseudo_func[FUNC_SEG_RELATIVE].u.sym;
|
||||||
e.X_add_number = 0;
|
e.X_add_number = 0;
|
||||||
e.X_add_symbol = unwind.info;
|
e.X_add_symbol = unwind.info;
|
||||||
ia64_cons_fix_new (frag_now, where + 16, 8, &e);
|
ia64_cons_fix_new (frag_now, where + (bytes_per_address * 2), bytes_per_address, &e);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
md_number_to_chars (ptr + 16, 0, 8);
|
md_number_to_chars (ptr + (bytes_per_address * 2), 0, bytes_per_address);
|
||||||
|
|
||||||
subseg_set (saved_seg, saved_subseg);
|
subseg_set (saved_seg, saved_subseg);
|
||||||
unwind.proc_start = unwind.proc_end = unwind.info = 0;
|
unwind.proc_start = unwind.proc_end = unwind.info = 0;
|
||||||
@ -5562,8 +5564,8 @@ emit_one_bundle ()
|
|||||||
t0 = end_of_insn_group | (template << 1) | (insn[0] << 5) | (insn[1] << 46);
|
t0 = end_of_insn_group | (template << 1) | (insn[0] << 5) | (insn[1] << 46);
|
||||||
t1 = ((insn[1] >> 18) & 0x7fffff) | (insn[2] << 23);
|
t1 = ((insn[1] >> 18) & 0x7fffff) | (insn[2] << 23);
|
||||||
|
|
||||||
md_number_to_chars (f + 0, t0, 8);
|
number_to_chars_littleendian (f + 0, t0, 8);
|
||||||
md_number_to_chars (f + 8, t1, 8);
|
number_to_chars_littleendian (f + 8, t1, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -5574,7 +5576,7 @@ md_parse_option (c, arg)
|
|||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
/* Switches from the Intel assembler. */
|
/* Switches from the Intel assembler. */
|
||||||
case 'M':
|
case 'm':
|
||||||
if (strcmp (arg, "ilp64") == 0
|
if (strcmp (arg, "ilp64") == 0
|
||||||
|| strcmp (arg, "lp64") == 0
|
|| strcmp (arg, "lp64") == 0
|
||||||
|| strcmp (arg, "p64") == 0)
|
|| strcmp (arg, "p64") == 0)
|
||||||
@ -5688,8 +5690,8 @@ md_show_usage (stream)
|
|||||||
{
|
{
|
||||||
fputs (_("\
|
fputs (_("\
|
||||||
IA-64 options:\n\
|
IA-64 options:\n\
|
||||||
-Milp32|-Milp64|-Mlp64|-Mp64 select data model (default -Mlp64)\n\
|
-milp32|-milp64|-mlp64|-mp64 select data model (default -mlp64)\n\
|
||||||
-Mle | -Mbe select little- or big-endian byte order (default -Mle)\n\
|
-mle | -mbe select little- or big-endian byte order (default -mle)\n\
|
||||||
-x | -xexplicit turn on dependency violation checking (default)\n\
|
-x | -xexplicit turn on dependency violation checking (default)\n\
|
||||||
-xauto automagically remove dependency violations\n\
|
-xauto automagically remove dependency violations\n\
|
||||||
-xdebug debug dependency violation checker\n"),
|
-xdebug debug dependency violation checker\n"),
|
||||||
@ -5740,7 +5742,7 @@ extra_goodness (int templ, int slot)
|
|||||||
void
|
void
|
||||||
md_begin ()
|
md_begin ()
|
||||||
{
|
{
|
||||||
int i, j, k, t, total, ar_base, cr_base, goodness, best, regnum;
|
int i, j, k, t, total, ar_base, cr_base, goodness, best, regnum, ok;
|
||||||
const char *err;
|
const char *err;
|
||||||
char name[8];
|
char name[8];
|
||||||
|
|
||||||
@ -5749,7 +5751,7 @@ md_begin ()
|
|||||||
|
|
||||||
bfd_set_section_alignment (stdoutput, text_section, 4);
|
bfd_set_section_alignment (stdoutput, text_section, 4);
|
||||||
|
|
||||||
target_big_endian = 0;
|
target_big_endian = TARGET_BYTES_BIG_ENDIAN;
|
||||||
pseudo_func[FUNC_FPTR_RELATIVE].u.sym =
|
pseudo_func[FUNC_FPTR_RELATIVE].u.sym =
|
||||||
symbol_new (".<fptr>", undefined_section, FUNC_FPTR_RELATIVE,
|
symbol_new (".<fptr>", undefined_section, FUNC_FPTR_RELATIVE,
|
||||||
&zero_address_frag);
|
&zero_address_frag);
|
||||||
@ -5948,9 +5950,15 @@ md_begin ()
|
|||||||
name, err);
|
name, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Default to 64-bit mode. */
|
/* Set the architecture and machine depending on defaults and command line
|
||||||
/* ??? This overrides the -M options, but they aren't working anyways. */
|
options. */
|
||||||
md.flags |= EF_IA_64_ABI64;
|
if (md.flags & EF_IA_64_ABI64)
|
||||||
|
ok = bfd_set_arch_mach (stdoutput, bfd_arch_ia64, bfd_mach_ia64_elf64);
|
||||||
|
else
|
||||||
|
ok = bfd_set_arch_mach (stdoutput, bfd_arch_ia64, bfd_mach_ia64_elf32);
|
||||||
|
|
||||||
|
if (! ok)
|
||||||
|
as_warn (_("Could not set architecture and machine"));
|
||||||
|
|
||||||
md.mem_offset.hint = 0;
|
md.mem_offset.hint = 0;
|
||||||
md.path = 0;
|
md.path = 0;
|
||||||
@ -5958,6 +5966,37 @@ md_begin ()
|
|||||||
md.entry_labels = NULL;
|
md.entry_labels = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set the elf type to 64 bit ABI by default. Cannot do this in md_begin
|
||||||
|
because that is called after md_parse_option which is where we do the
|
||||||
|
dynamic changing of md.flags based on -mlp64 or -milp32. Also, set the
|
||||||
|
default endianness. */
|
||||||
|
|
||||||
|
void
|
||||||
|
ia64_init (argc, argv)
|
||||||
|
int argc;
|
||||||
|
char **argv;
|
||||||
|
{
|
||||||
|
md.flags = EF_IA_64_ABI64;
|
||||||
|
if (TARGET_BYTES_BIG_ENDIAN)
|
||||||
|
md.flags |= EF_IA_64_BE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Return a string for the target object file format. */
|
||||||
|
|
||||||
|
const char *
|
||||||
|
ia64_target_format ()
|
||||||
|
{
|
||||||
|
if (OUTPUT_FLAVOR == bfd_target_elf_flavour)
|
||||||
|
{
|
||||||
|
if (md.flags & EF_IA_64_ABI64)
|
||||||
|
return "elf64-ia64-big";
|
||||||
|
else
|
||||||
|
return "elf32-ia64-big";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return "unknown-format";
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ia64_end_of_source ()
|
ia64_end_of_source ()
|
||||||
{
|
{
|
||||||
@ -9345,8 +9384,8 @@ fix_insn (fix, odesc, value)
|
|||||||
|
|
||||||
t0 = control_bits | (insn[0] << 5) | (insn[1] << 46);
|
t0 = control_bits | (insn[0] << 5) | (insn[1] << 46);
|
||||||
t1 = ((insn[1] >> 18) & 0x7fffff) | (insn[2] << 23);
|
t1 = ((insn[1] >> 18) & 0x7fffff) | (insn[2] << 23);
|
||||||
md_number_to_chars (fixpos + 0, t0, 8);
|
number_to_chars_littleendian (fixpos + 0, t0, 8);
|
||||||
md_number_to_chars (fixpos + 8, t1, 8);
|
number_to_chars_littleendian (fixpos + 8, t1, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Attempt to simplify or even eliminate a fixup. The return value is
|
/* Attempt to simplify or even eliminate a fixup. The return value is
|
||||||
|
@ -24,14 +24,27 @@
|
|||||||
|
|
||||||
#define TC_IA64
|
#define TC_IA64
|
||||||
|
|
||||||
#define TARGET_FORMAT (OUTPUT_FLAVOR == bfd_target_elf_flavour \
|
/* Linux is little endian by default. HPUX is big endian by default. */
|
||||||
? "elf64-ia64-little" \
|
#ifdef TE_HPUX
|
||||||
: "unknown-format")
|
#define md_number_to_chars number_to_chars_bigendian
|
||||||
|
#define TARGET_BYTES_BIG_ENDIAN 1
|
||||||
|
#else
|
||||||
|
#define md_number_to_chars number_to_chars_littleendian
|
||||||
|
#define TARGET_BYTES_BIG_ENDIAN 0
|
||||||
|
#endif /* TE_HPUX */
|
||||||
|
|
||||||
|
/* We need to set the default object file format in ia64_init and not in
|
||||||
|
md_begin. This is because parse_args is called before md_begin, and we
|
||||||
|
do not want md_begin to wipe out the flag settings set by options parsed in
|
||||||
|
md_parse_args. */
|
||||||
|
|
||||||
|
#define HOST_SPECIAL_INIT ia64_init
|
||||||
|
|
||||||
|
#define TARGET_FORMAT ia64_target_format()
|
||||||
|
extern const char *ia64_target_format PARAMS ((void));
|
||||||
|
|
||||||
#define TARGET_ARCH bfd_arch_ia64
|
#define TARGET_ARCH bfd_arch_ia64
|
||||||
#define TARGET_BYTES_BIG_ENDIAN 0
|
|
||||||
#define DOUBLESLASH_LINE_COMMENTS /* allow //-style comments */
|
#define DOUBLESLASH_LINE_COMMENTS /* allow //-style comments */
|
||||||
#define md_number_to_chars number_to_chars_littleendian
|
|
||||||
#define TC_HANDLES_FX_DONE
|
#define TC_HANDLES_FX_DONE
|
||||||
|
|
||||||
#define NEED_LITERAL_POOL /* need gp literal pool */
|
#define NEED_LITERAL_POOL /* need gp literal pool */
|
||||||
|
4
gas/config/te-hpux.h
Normal file
4
gas/config/te-hpux.h
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#define TE_HPUX
|
||||||
|
#define LOCAL_LABELS_FB 1
|
||||||
|
|
||||||
|
#include "obj-format.h"
|
339
gas/configure
vendored
339
gas/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -285,6 +285,7 @@ changequote([,])dnl
|
|||||||
|
|
||||||
ia64-*-elf*) fmt=elf ;;
|
ia64-*-elf*) fmt=elf ;;
|
||||||
ia64-*-linux-gnu*) fmt=elf em=linux ;;
|
ia64-*-linux-gnu*) fmt=elf em=linux ;;
|
||||||
|
ia64-*-hpux*) fmt=elf em=hpux ;;
|
||||||
|
|
||||||
m32r-*-*) fmt=elf bfd_gas=yes ;;
|
m32r-*-*) fmt=elf bfd_gas=yes ;;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user