From: Jeff Law Date: Sun, 31 Oct 1993 07:48:41 +0000 (+0000) Subject: * config/obj-som.h (obj_set_symbol_type): Define a hook so GAS X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e75acd689b12126432ca1ef8659d388475f12473;p=binutils-gdb.git * config/obj-som.h (obj_set_symbol_type): Define a hook so GAS can properly set all the SOM symbol types. * config/tc-hppa.c (pa_symbol_type): New enum to represent the symbol types which can be set from an IMPORT/EXPORT statement. (pa_export_args): Set the pa_symbol_type type based on arguments. If defined, call obj_set_symbol_type to pass this information on to the BFD backend. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index a0c8e45f6ee..8d60593ec36 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,13 @@ Sun Oct 31 00:36:40 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + * config/obj-som.h (obj_set_symbol_type): Define a hook so GAS + can properly set all the SOM symbol types. + * config/tc-hppa.c (pa_symbol_type): New enum to represent the + symbol types which can be set from an IMPORT/EXPORT statement. + (pa_export_args): Set the pa_symbol_type type based on arguments. + If defined, call obj_set_symbol_type to pass this information on + to the BFD backend. + * read.c (get_stab_string_offset): Set SEC_DEBUGGING for any stab section we make. (s_stab_generic): Likewise. diff --git a/gas/config/obj-som.h b/gas/config/obj-som.h index 00788736f4e..b97a8c07692 100644 --- a/gas/config/obj-som.h +++ b/gas/config/obj-som.h @@ -61,6 +61,9 @@ extern void obj_som_init_stab_section PARAMS ((segT)); #define obj_set_section_attributes bfd_som_set_section_attributes #define obj_set_subsection_attributes bfd_som_set_subsection_attributes +/* Likewise for symbol types. */ +#define obj_set_symbol_type bfd_som_set_symbol_type + /* Stabs go in a separate sections. GDB expects to find them in sections with the names $GDB_SYMBOLS$ and $GDB_STRINGS$ rather than .stab and .stabstr. */ diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c index 93a7feaca4d..b0337b7a145 100644 --- a/gas/config/tc-hppa.c +++ b/gas/config/tc-hppa.c @@ -183,6 +183,22 @@ typedef enum } fp_operand_format; +/* This fully describes the symbol types which may be attached to + an EXPORT or IMPORT directive. Only SOM uses this formation + (ELF has no need for it). */ +typedef enum +{ + SYMBOL_TYPE_UNKNOWN, + SYMBOL_TYPE_ABSOLUTE, + SYMBOL_TYPE_CODE, + SYMBOL_TYPE_DATA, + SYMBOL_TYPE_ENTRY, + SYMBOL_TYPE_MILLICODE, + SYMBOL_TYPE_PLABEL, + SYMBOL_TYPE_PRI_PROG, + SYMBOL_TYPE_SEC_PROG, +} pa_symbol_type; + /* This structure contains information needed to assemble individual instructions. */ struct pa_it @@ -4785,6 +4801,7 @@ pa_export_args (symbolP) { char *name, c, *p; unsigned int temp, arg_reloc; + pa_symbol_type type = SYMBOL_TYPE_UNKNOWN; obj_symbol_type *symbol = (obj_symbol_type *) symbolP->bsym; if (strncasecmp (input_line_pointer, "absolute", 8) == 0) @@ -4792,43 +4809,58 @@ pa_export_args (symbolP) input_line_pointer += 8; symbolP->bsym->flags &= ~BSF_FUNCTION; S_SET_SEGMENT (symbolP, &bfd_abs_section); + type = SYMBOL_TYPE_ABSOLUTE; } else if (strncasecmp (input_line_pointer, "code", 4) == 0) { input_line_pointer += 4; symbolP->bsym->flags &= ~BSF_FUNCTION; + type = SYMBOL_TYPE_CODE; } else if (strncasecmp (input_line_pointer, "data", 4) == 0) { input_line_pointer += 4; symbolP->bsym->flags &= ~BSF_FUNCTION; + type = SYMBOL_TYPE_DATA; } else if ((strncasecmp (input_line_pointer, "entry", 5) == 0)) { input_line_pointer += 5; symbolP->bsym->flags |= BSF_FUNCTION; + type = SYMBOL_TYPE_ENTRY; } else if (strncasecmp (input_line_pointer, "millicode", 9) == 0) { input_line_pointer += 9; symbolP->bsym->flags |= BSF_FUNCTION; + type = SYMBOL_TYPE_MILLICODE; } else if (strncasecmp (input_line_pointer, "plabel", 6) == 0) { input_line_pointer += 6; symbolP->bsym->flags &= ~BSF_FUNCTION; + type = SYMBOL_TYPE_PLABEL; } else if (strncasecmp (input_line_pointer, "pri_prog", 8) == 0) { input_line_pointer += 8; symbolP->bsym->flags |= BSF_FUNCTION; + type = SYMBOL_TYPE_PRI_PROG; } else if (strncasecmp (input_line_pointer, "sec_prog", 8) == 0) { input_line_pointer += 8; symbolP->bsym->flags |= BSF_FUNCTION; + type = SYMBOL_TYPE_SEC_PROG; } + /* SOM requires much more information about symbol types + than BFD understands. This is how we get this information + to the SOM BFD backend. */ +#ifdef obj_set_symbol_type + obj_set_symbol_type (symbolP->bsym, (int) type); +#endif + /* Now that the type of the exported symbol has been handled, handle any argument relocation information. */ while (!is_end_of_statement ())