mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 20:28:28 +08:00
Instead of changing the names of .bss etc, add .vubss etc via
the macro ELF_TC_SPECIAL_SECTIONS. As per Ian's suggestion.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
Mon Feb 23 17:24:06 1998 Jim Lemke <jlemke@cygnus.com>
|
||||||
|
|
||||||
|
* config/obj-elf.c: Take Ian's suggestion, leave .bss etc
|
||||||
|
in special_sections table and add .vubss etc via
|
||||||
|
ELF_TC_SPECIAL_SECTIONS.
|
||||||
|
* config/tc-dvp.h: Likewise.
|
||||||
|
|
||||||
Mon Feb 23 11:29:06 1998 Doug Evans <devans@seba.cygnus.com>
|
Mon Feb 23 11:29:06 1998 Doug Evans <devans@seba.cygnus.com>
|
||||||
|
|
||||||
* cgen.c: #include symcat.h.
|
* cgen.c: #include symcat.h.
|
||||||
|
@ -65,6 +65,7 @@ static void obj_elf_common PARAMS ((int));
|
|||||||
static void obj_elf_symver PARAMS ((int));
|
static void obj_elf_symver PARAMS ((int));
|
||||||
static void obj_elf_data PARAMS ((int));
|
static void obj_elf_data PARAMS ((int));
|
||||||
static void obj_elf_text PARAMS ((int));
|
static void obj_elf_text PARAMS ((int));
|
||||||
|
static void obj_elf_subsection PARAMS ((int));
|
||||||
|
|
||||||
static const pseudo_typeS elf_pseudo_table[] =
|
static const pseudo_typeS elf_pseudo_table[] =
|
||||||
{
|
{
|
||||||
@ -87,6 +88,9 @@ static const pseudo_typeS elf_pseudo_table[] =
|
|||||||
/* This is a GNU extension to handle symbol versions. */
|
/* This is a GNU extension to handle symbol versions. */
|
||||||
{"symver", obj_elf_symver, 0},
|
{"symver", obj_elf_symver, 0},
|
||||||
|
|
||||||
|
/* A GNU extension to change subsection only. */
|
||||||
|
{"subsection", obj_elf_subsection, 0},
|
||||||
|
|
||||||
/* These are used for dwarf. */
|
/* These are used for dwarf. */
|
||||||
{"2byte", cons, 2},
|
{"2byte", cons, 2},
|
||||||
{"4byte", cons, 4},
|
{"4byte", cons, 4},
|
||||||
@ -155,11 +159,11 @@ elf_begin ()
|
|||||||
{
|
{
|
||||||
/* Add symbols for the known sections to the symbol table. */
|
/* Add symbols for the known sections to the symbol table. */
|
||||||
symbol_table_insert (section_symbol (bfd_get_section_by_name (stdoutput,
|
symbol_table_insert (section_symbol (bfd_get_section_by_name (stdoutput,
|
||||||
".text")));
|
TEXT_SECTION_NAME)));
|
||||||
symbol_table_insert (section_symbol (bfd_get_section_by_name (stdoutput,
|
symbol_table_insert (section_symbol (bfd_get_section_by_name (stdoutput,
|
||||||
".data")));
|
DATA_SECTION_NAME)));
|
||||||
symbol_table_insert (section_symbol (bfd_get_section_by_name (stdoutput,
|
symbol_table_insert (section_symbol (bfd_get_section_by_name (stdoutput,
|
||||||
".bss")));
|
BSS_SECTION_NAME)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -617,6 +621,7 @@ obj_elf_section (xxx)
|
|||||||
++input_line_pointer;
|
++input_line_pointer;
|
||||||
|
|
||||||
SKIP_WHITESPACE ();
|
SKIP_WHITESPACE ();
|
||||||
|
|
||||||
if (*input_line_pointer == '"')
|
if (*input_line_pointer == '"')
|
||||||
{
|
{
|
||||||
/* Pick up a string with a combination of a, w, x. */
|
/* Pick up a string with a combination of a, w, x. */
|
||||||
@ -699,7 +704,7 @@ obj_elf_section (xxx)
|
|||||||
SKIP_WHITESPACE ();
|
SKIP_WHITESPACE ();
|
||||||
if (*input_line_pointer != '#')
|
if (*input_line_pointer != '#')
|
||||||
{
|
{
|
||||||
as_warn ("Bad .section directive");
|
as_warn ("Bad .section directive - character following name is not '#'");
|
||||||
ignore_rest_of_line ();
|
ignore_rest_of_line ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -845,6 +850,28 @@ obj_elf_text (i)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
obj_elf_subsection (ignore)
|
||||||
|
int ignore;
|
||||||
|
{
|
||||||
|
register int temp;
|
||||||
|
|
||||||
|
#ifdef md_flush_pending_output
|
||||||
|
md_flush_pending_output ();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
previous_section = now_seg;
|
||||||
|
previous_subsection = now_subseg;
|
||||||
|
|
||||||
|
temp = get_absolute_expression ();
|
||||||
|
subseg_set (now_seg, (subsegT) temp);
|
||||||
|
demand_empty_rest_of_line ();
|
||||||
|
|
||||||
|
#ifdef md_elf_section_change_hook
|
||||||
|
md_elf_section_change_hook ();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/* This can be called from the processor backends if they change
|
/* This can be called from the processor backends if they change
|
||||||
sections. */
|
sections. */
|
||||||
|
|
||||||
@ -1373,10 +1400,17 @@ elf_frob_symbol (symp, puntp)
|
|||||||
|
|
||||||
#ifdef TC_MIPS
|
#ifdef TC_MIPS
|
||||||
/* The Irix 5 and 6 assemblers set the type of any common symbol and
|
/* The Irix 5 and 6 assemblers set the type of any common symbol and
|
||||||
any undefined non-function symbol to STT_OBJECT. We try to be compatible,
|
any undefined non-function symbol to STT_OBJECT. We try to be
|
||||||
since newer Irix 5 and 6 linkers care. */
|
compatible, since newer Irix 5 and 6 linkers care. However, we
|
||||||
if (S_IS_COMMON (symp)
|
only set undefined symbols to be STT_OBJECT if we are on Irix,
|
||||||
|| (! S_IS_DEFINED (symp) && ((symp->bsym->flags & BSF_FUNCTION) == 0)))
|
because that is the only time gcc will generate the necessary
|
||||||
|
.global directives to mark functions. */
|
||||||
|
|
||||||
|
if (S_IS_COMMON (symp))
|
||||||
|
symp->bsym->flags |= BSF_OBJECT;
|
||||||
|
|
||||||
|
if (strstr (TARGET_OS, "irix") != NULL
|
||||||
|
&& (! S_IS_DEFINED (symp) && ((symp->bsym->flags & BSF_FUNCTION) == 0)))
|
||||||
symp->bsym->flags |= BSF_OBJECT;
|
symp->bsym->flags |= BSF_OBJECT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -52,3 +52,17 @@
|
|||||||
#define MD_APPLY_FIX3
|
#define MD_APPLY_FIX3
|
||||||
|
|
||||||
#define TC_HANDLES_FX_DONE
|
#define TC_HANDLES_FX_DONE
|
||||||
|
|
||||||
|
/* Called after parsing a file. */
|
||||||
|
#define md_after_pass_hook() dvp_parse_done ()
|
||||||
|
|
||||||
|
/* Default section names. */
|
||||||
|
#define TEXT_SECTION_NAME ".vutext"
|
||||||
|
#define DATA_SECTION_NAME ".vudata"
|
||||||
|
#define BSS_SECTION_NAME ".vubss"
|
||||||
|
|
||||||
|
#define ELF_TC_SPECIAL_SECTIONS \
|
||||||
|
{ ".vubss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, \
|
||||||
|
{ ".vudata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, \
|
||||||
|
{ ".vutext", SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user