mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-08 09:03:40 +08:00
more Utah changes, some cleanup of mine
This commit is contained in:
parent
6a54ad639f
commit
5cf4cd1b8b
@ -545,7 +545,8 @@ elf_stab_symbol_string (string, secname)
|
|||||||
if (seg == 0)
|
if (seg == 0)
|
||||||
{
|
{
|
||||||
seg = bfd_make_section_old_way (stdoutput, newsecname);
|
seg = bfd_make_section_old_way (stdoutput, newsecname);
|
||||||
bfd_set_section_flags (stdoutput, seg, SEC_READONLY | SEC_ALLOC);
|
bfd_set_section_flags (stdoutput, seg,
|
||||||
|
SEC_LOAD | SEC_READONLY | SEC_ALLOC);
|
||||||
}
|
}
|
||||||
/* free (newsecname);*/
|
/* free (newsecname);*/
|
||||||
}
|
}
|
||||||
@ -610,7 +611,7 @@ obj_elf_stab_generic (what, secname)
|
|||||||
asection *seg;
|
asection *seg;
|
||||||
subsegT subseg = now_subseg;
|
subsegT subseg = now_subseg;
|
||||||
|
|
||||||
#if 1
|
#if 0
|
||||||
/* This function doesn't work yet.
|
/* This function doesn't work yet.
|
||||||
|
|
||||||
Actually, this function is okay, but some finalizations are
|
Actually, this function is okay, but some finalizations are
|
||||||
@ -629,7 +630,7 @@ obj_elf_stab_generic (what, secname)
|
|||||||
{
|
{
|
||||||
seg = subseg_new (secname, 0);
|
seg = subseg_new (secname, 0);
|
||||||
bfd_set_section_flags (stdoutput, seg,
|
bfd_set_section_flags (stdoutput, seg,
|
||||||
SEC_READONLY | SEC_ALLOC | SEC_RELOC);
|
SEC_LOAD | SEC_READONLY | SEC_ALLOC | SEC_RELOC);
|
||||||
subseg_set (saved_seg, subseg);
|
subseg_set (saved_seg, subseg);
|
||||||
seg_is_new = 1;
|
seg_is_new = 1;
|
||||||
}
|
}
|
||||||
@ -751,7 +752,7 @@ obj_elf_stab_generic (what, secname)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *p = frag_more (4);
|
char *p = frag_more (4);
|
||||||
md_number_to_chars (p, 0, 0);
|
md_number_to_chars (p, 0, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
subseg_new ((char *) saved_seg->name, subseg);
|
subseg_new ((char *) saved_seg->name, subseg);
|
||||||
@ -908,7 +909,7 @@ obj_elf_version ()
|
|||||||
note_secp = bfd_make_section_old_way (stdoutput, ".note");
|
note_secp = bfd_make_section_old_way (stdoutput, ".note");
|
||||||
bfd_set_section_flags (stdoutput,
|
bfd_set_section_flags (stdoutput,
|
||||||
note_secp,
|
note_secp,
|
||||||
SEC_LOAD | SEC_ALLOC | SEC_HAS_CONTENTS);
|
SEC_LOAD | SEC_HAS_CONTENTS | SEC_READONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* process the version string */
|
/* process the version string */
|
||||||
@ -1107,18 +1108,18 @@ elf_frob_file ()
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < stdoutput->symcount; i++)
|
for (i = 0; i < stdoutput->symcount; i++)
|
||||||
elf_tc_symbol (stdoutput, (elf_symbol_type *) (stdoutput->outsymbols[i]),
|
elf_tc_symbol (stdoutput, (PTR) (stdoutput->outsymbols[i]),
|
||||||
i + 1);
|
i + 1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef elf_tc_final_processing
|
#ifdef elf_tc_final_processing
|
||||||
elf_tc_final_processing_hook ();
|
elf_tc_final_processing ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Finally, we must make any target-specific sections. */
|
/* Finally, we must make any target-specific sections. */
|
||||||
|
|
||||||
#ifdef elf_tc_make_sections
|
#ifdef elf_tc_make_sections
|
||||||
elf_tc_make_sections (stdoutput, NULL);
|
elf_tc_make_sections (stdoutput);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
/* tc-hppa.h -- Header file for the PA */
|
/* tc-hppa.h -- Header file for the PA */
|
||||||
|
|
||||||
/* Copyright (C) 1989 Free Software Foundation, Inc.
|
/* Copyright (C) 1989, 1993 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GAS, the GNU Assembler.
|
This file is part of GAS, the GNU Assembler.
|
||||||
|
|
||||||
@ -31,9 +31,15 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#define TC_HPPA 1
|
#define TC_HPPA 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef OBJ_ELF
|
||||||
|
#include "../bfd/elf32-hppa.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define TARGET_ARCH bfd_arch_hppa
|
#define TARGET_ARCH bfd_arch_hppa
|
||||||
#define TARGET_FORMAT "elf32-hppa"
|
#define TARGET_FORMAT "elf32-hppa"
|
||||||
|
|
||||||
|
/* Local labels have an "L$" prefix. */
|
||||||
|
#define LOCAL_LABEL(name) ((name)[0] == 'L' && (name)[1] == '$')
|
||||||
#define ASEC_NULL (asection *)0
|
#define ASEC_NULL (asection *)0
|
||||||
|
|
||||||
/* We can do sym1 - sym2 as long as sym2 is $global$ */
|
/* We can do sym1 - sym2 as long as sym2 is $global$ */
|
||||||
@ -106,6 +112,7 @@ void pa_entry (), pa_equ (), pa_exit (), pa_export ();
|
|||||||
void pa_export_args (), pa_import (), pa_label (), pa_leave ();
|
void pa_export_args (), pa_import (), pa_label (), pa_leave ();
|
||||||
void pa_origin (), pa_proc (), pa_procend (), pa_space ();
|
void pa_origin (), pa_proc (), pa_procend (), pa_space ();
|
||||||
void pa_spnum (), pa_subspace (), pa_version ();
|
void pa_spnum (), pa_subspace (), pa_version ();
|
||||||
|
void pa_param();
|
||||||
|
|
||||||
extern const pseudo_typeS md_pseudo_table[];
|
extern const pseudo_typeS md_pseudo_table[];
|
||||||
|
|
||||||
@ -150,28 +157,6 @@ int need_89_opcode ();
|
|||||||
int pa_89_parse_number ();
|
int pa_89_parse_number ();
|
||||||
|
|
||||||
|
|
||||||
/* pa-ctrl-func.h -- Control Structures and Functions for the PA */
|
|
||||||
|
|
||||||
extern unsigned int assemble_3 ( /* unsigned int x; */ );
|
|
||||||
|
|
||||||
extern void dis_assemble_3 ( /* unsigned int x, *r; */ );
|
|
||||||
|
|
||||||
extern unsigned int assemble_12 ( /* unsigned int x,y; */ );
|
|
||||||
|
|
||||||
extern void dis_assemble_12 ( /* unsigned int as12, *x,*y */ );
|
|
||||||
|
|
||||||
extern unsigned long assemble_17 ( /* unsigned int x,y,z */ );
|
|
||||||
|
|
||||||
extern void dis_assemble_17 ( /* unsigned int as17, *x,*y,*z */ );
|
|
||||||
|
|
||||||
extern unsigned long assemble_21 ( /* unsigned int x; */ );
|
|
||||||
|
|
||||||
extern void dis_assemble_21 ( /* unsigned int as21,*x; */ );
|
|
||||||
|
|
||||||
extern void sign_unext ( /* unsigned int x,len; unsigned int *result */ );
|
|
||||||
|
|
||||||
extern void low_sign_unext ( /* unsigned int x,len; unsigned int *result */ );
|
|
||||||
|
|
||||||
struct call_desc
|
struct call_desc
|
||||||
{
|
{
|
||||||
unsigned int arg_reloc;
|
unsigned int arg_reloc;
|
||||||
@ -237,7 +222,7 @@ struct subspace_dictionary_chain
|
|||||||
the object file is written */
|
the object file is written */
|
||||||
int ssd_last_align; /* the size of the last alignment
|
int ssd_last_align; /* the size of the last alignment
|
||||||
request for this subspace */
|
request for this subspace */
|
||||||
symbolS *ssd_start_sym; /* a symbol whose value is the
|
struct symbol *ssd_start_sym; /* a symbol whose value is the
|
||||||
start of this subspace */
|
start of this subspace */
|
||||||
struct subspace_dictionary_chain *ssd_next; /* next subspace dict. entry */
|
struct subspace_dictionary_chain *ssd_next; /* next subspace dict. entry */
|
||||||
};
|
};
|
||||||
@ -336,15 +321,15 @@ typedef struct space_dictionary_chain space_dict_chainS;
|
|||||||
|
|
||||||
#define STAB_FIXUP(frag,toptr,symP,stab_type) \
|
#define STAB_FIXUP(frag,toptr,symP,stab_type) \
|
||||||
if ( (stab_type == 's' || stab_type == 'n') \
|
if ( (stab_type == 's' || stab_type == 'n') \
|
||||||
&& symP->sy_value.X_seg == undefined_section) \
|
&& symP->sy_value.X_op == O_symbol) \
|
||||||
{ \
|
{ \
|
||||||
int i = S_GET_TYPE(symP) & N_TYPE; \
|
int i = S_GET_TYPE(symP) & N_TYPE; \
|
||||||
fix_new_hppa(frag, \
|
fix_new_hppa(frag, \
|
||||||
toptr-frag->fr_literal, /* where */ \
|
toptr-frag->fr_literal, /* where */ \
|
||||||
4, /* size */ \
|
4, /* size */ \
|
||||||
symP->sy_value.X_add_symbol, /* addr of sym for this stab */ \
|
symP->sy_value.X_add_symbol, /* addr of sym for this stab */ \
|
||||||
(asymbol *)NULL, \
|
(offsetT) 0, \
|
||||||
0, \
|
(expressionS *) NULL, \
|
||||||
i == N_UNDF || i == N_ABS, /* 1 if internal reloc */ \
|
i == N_UNDF || i == N_ABS, /* 1 if internal reloc */ \
|
||||||
R_HPPA, /* type */ \
|
R_HPPA, /* type */ \
|
||||||
e_fsel, /* fixup fld = F% */ \
|
e_fsel, /* fixup fld = F% */ \
|
||||||
@ -359,8 +344,8 @@ typedef struct space_dictionary_chain space_dict_chainS;
|
|||||||
toptr-frag->fr_literal, /* where */ \
|
toptr-frag->fr_literal, /* where */ \
|
||||||
4, /* size */ \
|
4, /* size */ \
|
||||||
symP, /* addr of sym for this stab */ \
|
symP, /* addr of sym for this stab */ \
|
||||||
(asymbol *)NULL, \
|
(offsetT) 0, \
|
||||||
0, \
|
(expressionS *) NULL, \
|
||||||
0, \
|
0, \
|
||||||
R_HPPA, /* type */ \
|
R_HPPA, /* type */ \
|
||||||
e_fsel, /* fixup fld = F% */ \
|
e_fsel, /* fixup fld = F% */ \
|
||||||
@ -422,9 +407,9 @@ extern int is_last_defined_subspace ();
|
|||||||
|
|
||||||
/* symbol support */
|
/* symbol support */
|
||||||
|
|
||||||
extern symbolS *pa_get_start_symbol ();
|
extern struct symbol *pa_get_start_symbol ();
|
||||||
|
|
||||||
extern symbolS *pa_set_start_symbol ();
|
extern struct symbol *pa_set_start_symbol ();
|
||||||
|
|
||||||
/* default space and subspace dictionaries */
|
/* default space and subspace dictionaries */
|
||||||
|
|
||||||
@ -432,7 +417,8 @@ struct default_subspace_dict
|
|||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
char defined;
|
char defined;
|
||||||
char loadable, code_only, common, dup_common, zero, sort;
|
char loadable, code_only, common, dup_common, zero;
|
||||||
|
unsigned char sort;
|
||||||
int access, space_index, alignment, quadrant;
|
int access, space_index, alignment, quadrant;
|
||||||
#ifdef OBJ_SOM
|
#ifdef OBJ_SOM
|
||||||
segT segment;
|
segT segment;
|
||||||
@ -452,12 +438,13 @@ struct default_space_dict
|
|||||||
char loadable;
|
char loadable;
|
||||||
char defined;
|
char defined;
|
||||||
char private;
|
char private;
|
||||||
char sort;
|
unsigned char sort;
|
||||||
#ifdef OBJ_SOM
|
#ifdef OBJ_SOM
|
||||||
segT segment;
|
segT segment;
|
||||||
#else
|
#else
|
||||||
asection *segment;
|
asection *segment;
|
||||||
char *alias; /* an alias for this section (or NULL if there isn't one) */
|
/* an alias for this section (or NULL if there isn't one) */
|
||||||
|
char *alias;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -472,50 +459,58 @@ extern struct default_space_dict pa_def_spaces[];
|
|||||||
|
|
||||||
typedef struct label_symbol_struct
|
typedef struct label_symbol_struct
|
||||||
{
|
{
|
||||||
symbolS *lss_label; /* the label symbol */
|
/* the label symbol */
|
||||||
space_dict_chainS *lss_space; /* the space to which it applies*/
|
struct symbol *lss_label;
|
||||||
struct label_symbol_struct *lss_next; /* the next label symbol */
|
/* the space to which it applies */
|
||||||
|
space_dict_chainS *lss_space;
|
||||||
|
/* the next label symbol */
|
||||||
|
struct label_symbol_struct *lss_next;
|
||||||
} label_symbolS;
|
} label_symbolS;
|
||||||
|
|
||||||
extern label_symbolS *label_symbols_rootP;
|
|
||||||
|
|
||||||
label_symbolS *pa_get_label ();
|
|
||||||
int pa_label_is_defined ();
|
|
||||||
void pa_define_label ();
|
void pa_define_label ();
|
||||||
void pa_undefine_label ();
|
|
||||||
int pa_pseudo_op_moves_pc ();
|
|
||||||
|
|
||||||
/* end of label symbol support. */
|
/* end of label symbol support. */
|
||||||
|
|
||||||
#define is_DP_relative(exp) ( (exp).X_subtract_symbol \
|
#define is_DP_relative(exp) \
|
||||||
&& strcmp((exp).X_subtract_symbol->bsym->name, \
|
((exp).X_op == O_subtract \
|
||||||
"$global$") == 0 )
|
&& strcmp((exp).X_op_symbol->bsym->name, "$global$") == 0)
|
||||||
|
|
||||||
#define is_PC_relative(exp) ( (exp).X_subtract_symbol \
|
#define is_PC_relative(exp) \
|
||||||
&& strcmp((exp).X_subtract_symbol->bsym->name, \
|
((exp).X_op == O_subtract \
|
||||||
"$PIC_pcrel$0") == 0 )
|
&& strcmp((exp).X_op_symbol->bsym->name, "$PIC_pcrel$0") == 0)
|
||||||
|
|
||||||
#define is_complex(exp) ((exp).X_seg && (exp).X_seg == diff_section)
|
#define is_complex(exp) \
|
||||||
|
((exp).X_op != O_constant && (exp).X_op != O_symbol)
|
||||||
|
|
||||||
#define tc_crawl_symbol_chain(headers) {;} /* Not used. */
|
#define tc_crawl_symbol_chain(headers) {;} /* Not used. */
|
||||||
|
|
||||||
#define tc_headers_hook(headers) {;} /* Not used. */
|
#define tc_headers_hook(headers) {;} /* Not used. */
|
||||||
|
|
||||||
#define elf_tc_symbol elf_hppa_tc_symbol
|
#define elf_tc_symbol hppa_tc_symbol
|
||||||
#define elf_tc_make_sections elf_hppa_tc_make_sections
|
#define elf_tc_make_sections hppa_tc_make_sections
|
||||||
extern void elf_hppa_final_processing ();
|
extern void elf_hppa_final_processing ();
|
||||||
#define elf_tc_final_processing elf_hppa_final_processing
|
#define elf_tc_final_processing elf_hppa_final_processing
|
||||||
|
|
||||||
/* We need to parse field selectors in .byte, etc. */
|
/* We need to parse field selectors in .byte, etc. */
|
||||||
|
|
||||||
#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) \
|
#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) \
|
||||||
parse_cons_expression_hppa (exp)
|
parse_cons_expression_hppa (EXP)
|
||||||
#define TC_CONS_FIX_NEW cons_fix_new_hppa
|
#define TC_CONS_FIX_NEW cons_fix_new_hppa
|
||||||
|
|
||||||
extern void parse_cons_expression_hppa PARAMS ((expressionS *exp));
|
/* FIXME these used to be prototypes, but both want an expressionS which
|
||||||
extern void cons_fix_new_hppa PARAMS ((fragS *frag,
|
is not defined when this file is included. */
|
||||||
int where,
|
extern void parse_cons_expression_hppa ();
|
||||||
int size,
|
extern void cons_fix_new_hppa ();
|
||||||
expressionS *exp));
|
|
||||||
|
/* On the PA, an equal sign often appears as a condition or nullification
|
||||||
|
completer in an instruction. This can be detected by checking the
|
||||||
|
previous character, if the character is a comma, then the equal is
|
||||||
|
being used as part of an instruction. */
|
||||||
|
#define TC_EQUAL_IN_INSN(C, PTR) ((C) == ',')
|
||||||
|
|
||||||
|
/* Similarly for an exclamation point. It is used in FP comparison
|
||||||
|
instructions and as an end of line marker. When used in an instruction
|
||||||
|
it will always follow a comma. */
|
||||||
|
#define TC_EOL_IN_INSN(PTR) (is_end_of_line[*(PTR)] && (PTR)[-1] == ',')
|
||||||
|
|
||||||
#endif /* _TC_HPPA_H */
|
#endif /* _TC_HPPA_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user