* config/obj-elf.c (elf_begin): New function.
(obj_elf_section): Add the section symbol to the symbol table. * config/obj-elf.h (obj_begin): Define. (elf_begin): Declare. * as.c (perform_an_assembly_pass): Call obj_begin if it is defined.
This commit is contained in:
parent
f2b435665b
commit
0bd28bc4f4
|
@ -1,3 +1,12 @@
|
||||||
|
Mon Oct 7 11:24:29 1996 Ian Lance Taylor <ian@cygnus.com>
|
||||||
|
|
||||||
|
* config/obj-elf.c (elf_begin): New function.
|
||||||
|
(obj_elf_section): Add the section symbol to the symbol table.
|
||||||
|
* config/obj-elf.h (obj_begin): Define.
|
||||||
|
(elf_begin): Declare.
|
||||||
|
* as.c (perform_an_assembly_pass): Call obj_begin if it is
|
||||||
|
defined.
|
||||||
|
|
||||||
Fri Oct 4 18:37:32 1996 Ian Lance Taylor <ian@cygnus.com>
|
Fri Oct 4 18:37:32 1996 Ian Lance Taylor <ian@cygnus.com>
|
||||||
|
|
||||||
* config/obj-coff.c (fixup_segment): Subtract the section address
|
* config/obj-coff.c (fixup_segment): Subtract the section address
|
||||||
|
|
4
gas/as.c
4
gas/as.c
|
@ -788,6 +788,10 @@ perform_an_assembly_pass (argc, argv)
|
||||||
and sections already created, in BFD_ASSEMBLER mode. */
|
and sections already created, in BFD_ASSEMBLER mode. */
|
||||||
md_begin ();
|
md_begin ();
|
||||||
|
|
||||||
|
#ifdef obj_begin
|
||||||
|
obj_begin ();
|
||||||
|
#endif
|
||||||
|
|
||||||
argv++; /* skip argv[0] */
|
argv++; /* skip argv[0] */
|
||||||
argc--; /* skip argv[0] */
|
argc--; /* skip argv[0] */
|
||||||
while (argc--)
|
while (argc--)
|
||||||
|
|
|
@ -136,6 +136,20 @@ static const pseudo_typeS ecoff_debug_pseudo_table[] =
|
||||||
#undef NO_RELOC
|
#undef NO_RELOC
|
||||||
#include "aout/aout64.h"
|
#include "aout/aout64.h"
|
||||||
|
|
||||||
|
/* This is called when the assembler starts. */
|
||||||
|
|
||||||
|
void
|
||||||
|
elf_begin ()
|
||||||
|
{
|
||||||
|
/* Add symbols for the known sections to the symbol table. */
|
||||||
|
symbol_table_insert (section_symbol (bfd_get_section_by_name (stdoutput,
|
||||||
|
".text")));
|
||||||
|
symbol_table_insert (section_symbol (bfd_get_section_by_name (stdoutput,
|
||||||
|
".data")));
|
||||||
|
symbol_table_insert (section_symbol (bfd_get_section_by_name (stdoutput,
|
||||||
|
".bss")));
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
elf_pop_insert ()
|
elf_pop_insert ()
|
||||||
{
|
{
|
||||||
|
@ -499,6 +513,7 @@ obj_elf_section (xxx)
|
||||||
int type, attr;
|
int type, attr;
|
||||||
int i;
|
int i;
|
||||||
flagword flags;
|
flagword flags;
|
||||||
|
symbolS *secsym;
|
||||||
|
|
||||||
#ifdef md_flush_pending_output
|
#ifdef md_flush_pending_output
|
||||||
md_flush_pending_output ();
|
md_flush_pending_output ();
|
||||||
|
@ -731,24 +746,33 @@ obj_elf_section (xxx)
|
||||||
|
|
||||||
flags = (SEC_RELOC
|
flags = (SEC_RELOC
|
||||||
| ((attr & SHF_WRITE) ? 0 : SEC_READONLY)
|
| ((attr & SHF_WRITE) ? 0 : SEC_READONLY)
|
||||||
| ((attr & SHF_ALLOC) ? SEC_ALLOC | SEC_LOAD : 0)
|
| ((attr & SHF_ALLOC) ? SEC_ALLOC : 0)
|
||||||
|
| (((attr & SHF_ALLOC) && type != SHT_NOBITS) ? SEC_LOAD : 0)
|
||||||
| ((attr & SHF_EXECINSTR) ? SEC_CODE : 0));
|
| ((attr & SHF_EXECINSTR) ? SEC_CODE : 0));
|
||||||
|
if (special_sections[i].name == NULL)
|
||||||
if (type == SHT_PROGBITS)
|
|
||||||
flags |= SEC_ALLOC | SEC_LOAD;
|
|
||||||
else if (type == SHT_NOBITS)
|
|
||||||
{
|
{
|
||||||
flags |= SEC_ALLOC;
|
if (type == SHT_PROGBITS)
|
||||||
flags &=~ SEC_LOAD;
|
flags |= SEC_ALLOC | SEC_LOAD;
|
||||||
}
|
else if (type == SHT_NOBITS)
|
||||||
|
{
|
||||||
|
flags |= SEC_ALLOC;
|
||||||
|
flags &=~ SEC_LOAD;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef md_elf_section_flags
|
#ifdef md_elf_section_flags
|
||||||
if (special_sections[i].name == NULL)
|
flags = md_elf_section_flags (flags, attr, type);
|
||||||
flags = md_elf_section_flags (flags, attr, type);
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
bfd_set_section_flags (stdoutput, sec, flags);
|
bfd_set_section_flags (stdoutput, sec, flags);
|
||||||
|
|
||||||
|
/* Add a symbol for this section to the symbol table. */
|
||||||
|
secsym = symbol_find (string);
|
||||||
|
if (secsym != NULL)
|
||||||
|
secsym->bsym = sec->symbol;
|
||||||
|
else
|
||||||
|
symbol_table_insert (section_symbol (sec));
|
||||||
|
|
||||||
#ifdef md_elf_section_change_hook
|
#ifdef md_elf_section_change_hook
|
||||||
md_elf_section_change_hook ();
|
md_elf_section_change_hook ();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -51,6 +51,9 @@
|
||||||
#define TRUE !FALSE
|
#define TRUE !FALSE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define obj_begin() elf_begin ()
|
||||||
|
extern void elf_begin PARAMS ((void));
|
||||||
|
|
||||||
/* should be conditional on address size! */
|
/* should be conditional on address size! */
|
||||||
#define elf_symbol(asymbol) ((elf_symbol_type *)(&(asymbol)->the_bfd))
|
#define elf_symbol(asymbol) ((elf_symbol_type *)(&(asymbol)->the_bfd))
|
||||||
|
|
||||||
|
@ -92,6 +95,11 @@ extern void obj_elf_version PARAMS ((int));
|
||||||
extern void obj_elf_init_stab_section PARAMS ((segT));
|
extern void obj_elf_init_stab_section PARAMS ((segT));
|
||||||
#define INIT_STAB_SECTION(seg) obj_elf_init_stab_section (seg)
|
#define INIT_STAB_SECTION(seg) obj_elf_init_stab_section (seg)
|
||||||
|
|
||||||
|
/* For now, always set ECOFF_DEBUGGING for an Alpha target. */
|
||||||
|
#ifdef TC_ALPHA
|
||||||
|
#define ECOFF_DEBUGGING 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* For now, always set ECOFF_DEBUGGING for a MIPS target. */
|
/* For now, always set ECOFF_DEBUGGING for a MIPS target. */
|
||||||
#ifdef TC_MIPS
|
#ifdef TC_MIPS
|
||||||
#define ECOFF_DEBUGGING 1
|
#define ECOFF_DEBUGGING 1
|
||||||
|
|
Loading…
Reference in New Issue