mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 12:23:31 +08:00
* config/obj-ecoff.c (get_tag): Save tag name in permanent memory
and in hash_ptr->string.
This commit is contained in:
@ -1,5 +1,8 @@
|
|||||||
Mon Aug 2 17:35:48 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
Mon Aug 2 17:35:48 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
||||||
|
|
||||||
|
* config/obj-ecoff.c (get_tag): Save tag name in permanent memory
|
||||||
|
and in hash_ptr->string.
|
||||||
|
|
||||||
* app.c (do_scrub_next_char): Reset state to 0 after .appline if
|
* app.c (do_scrub_next_char): Reset state to 0 after .appline if
|
||||||
file name is not seen.
|
file name is not seen.
|
||||||
|
|
||||||
|
@ -2108,11 +2108,16 @@ get_tag (tag, sym, basic_type)
|
|||||||
|
|
||||||
if (hash_ptr == (shash_t *) NULL)
|
if (hash_ptr == (shash_t *) NULL)
|
||||||
{
|
{
|
||||||
|
char *perm;
|
||||||
|
|
||||||
|
perm = xmalloc (strlen (tag) + 1);
|
||||||
|
strcpy (perm, tag);
|
||||||
hash_ptr = allocate_shash ();
|
hash_ptr = allocate_shash ();
|
||||||
err = hash_insert (tag_hash, tag, (char *) hash_ptr);
|
err = hash_insert (tag_hash, perm, (char *) hash_ptr);
|
||||||
if (*err != '\0')
|
if (*err != '\0')
|
||||||
as_fatal ("Inserting \"%s\" into tag hash table: %s",
|
as_fatal ("Inserting \"%s\" into tag hash table: %s",
|
||||||
tag, err);
|
tag, err);
|
||||||
|
hash_ptr->string = perm;
|
||||||
}
|
}
|
||||||
|
|
||||||
tag_ptr = allocate_tag ();
|
tag_ptr = allocate_tag ();
|
||||||
@ -3844,19 +3849,28 @@ ecoff_build_symbols (buf,
|
|||||||
|
|
||||||
/* The value of a block start symbol is the
|
/* The value of a block start symbol is the
|
||||||
offset from the start of the procedure. For
|
offset from the start of the procedure. For
|
||||||
other symbols we just use the gas value. */
|
other symbols we just use the gas value (but
|
||||||
|
we must offset it by the vma of the section,
|
||||||
|
just as BFD does, because BFD will not see
|
||||||
|
this value). */
|
||||||
if (sym_ptr->ecoff_sym.st == (int) st_Block
|
if (sym_ptr->ecoff_sym.st == (int) st_Block
|
||||||
&& sym_ptr->ecoff_sym.sc == (int) sc_Text)
|
&& sym_ptr->ecoff_sym.sc == (int) sc_Text)
|
||||||
{
|
{
|
||||||
|
symbolS *begin_sym;
|
||||||
|
|
||||||
know (sym_ptr->proc_ptr != (proc_t *) NULL);
|
know (sym_ptr->proc_ptr != (proc_t *) NULL);
|
||||||
|
begin_sym = sym_ptr->proc_ptr->sym->as_sym;
|
||||||
|
if (S_GET_SEGMENT (as_sym)
|
||||||
|
!= S_GET_SEGMENT (begin_sym))
|
||||||
|
as_warn (".begin/.bend in different segments");
|
||||||
sym_ptr->ecoff_sym.value =
|
sym_ptr->ecoff_sym.value =
|
||||||
(bfd_asymbol_value (as_sym->bsym)
|
S_GET_VALUE (as_sym) - S_GET_VALUE (begin_sym);
|
||||||
- bfd_asymbol_value (sym_ptr->proc_ptr->sym
|
|
||||||
->as_sym->bsym));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sym_ptr->ecoff_sym.value =
|
sym_ptr->ecoff_sym.value =
|
||||||
bfd_asymbol_value (as_sym->bsym);
|
(S_GET_VALUE (as_sym)
|
||||||
|
+ bfd_get_section_vma (stdoutput,
|
||||||
|
S_GET_SEGMENT (as_sym)));
|
||||||
|
|
||||||
/* Set st_Proc to st_StaticProc for local
|
/* Set st_Proc to st_StaticProc for local
|
||||||
functions. */
|
functions. */
|
||||||
@ -4000,19 +4014,26 @@ ecoff_build_symbols (buf,
|
|||||||
{
|
{
|
||||||
know (as_sym != (symbolS *) NULL);
|
know (as_sym != (symbolS *) NULL);
|
||||||
know (begin_ptr->as_sym != (symbolS *) NULL);
|
know (begin_ptr->as_sym != (symbolS *) NULL);
|
||||||
|
if (S_GET_SEGMENT (as_sym)
|
||||||
|
!= S_GET_SEGMENT (begin_ptr->as_sym))
|
||||||
|
as_warn (".begin/.bend in different segments");
|
||||||
sym_ptr->ecoff_sym.value =
|
sym_ptr->ecoff_sym.value =
|
||||||
(bfd_asymbol_value (as_sym->bsym)
|
(S_GET_VALUE (as_sym)
|
||||||
- bfd_asymbol_value (begin_ptr->as_sym->bsym));
|
- S_GET_VALUE (begin_ptr->as_sym));
|
||||||
}
|
}
|
||||||
else if (begin_type == st_Block
|
else if (begin_type == st_Block
|
||||||
&& sym_ptr->ecoff_sym.sc != (int) sc_Info)
|
&& sym_ptr->ecoff_sym.sc != (int) sc_Info)
|
||||||
{
|
{
|
||||||
|
symbolS *begin_sym;
|
||||||
|
|
||||||
know (as_sym != (symbolS *) NULL);
|
know (as_sym != (symbolS *) NULL);
|
||||||
know (sym_ptr->proc_ptr != (proc_t *) NULL);
|
know (sym_ptr->proc_ptr != (proc_t *) NULL);
|
||||||
|
begin_sym = sym_ptr->proc_ptr->sym->as_sym;
|
||||||
|
if (S_GET_SEGMENT (as_sym)
|
||||||
|
!= S_GET_SEGMENT (begin_sym))
|
||||||
|
as_warn (".begin/.bend in different segments");
|
||||||
sym_ptr->ecoff_sym.value =
|
sym_ptr->ecoff_sym.value =
|
||||||
(bfd_asymbol_value (as_sym->bsym)
|
S_GET_VALUE (as_sym) - S_GET_VALUE (begin_sym);
|
||||||
- bfd_asymbol_value (sym_ptr->proc_ptr->sym
|
|
||||||
->as_sym->bsym));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4143,9 +4164,13 @@ ecoff_build_procs (buf, bufend, offset)
|
|||||||
proc_end = proc_ptr + proc_cnt;
|
proc_end = proc_ptr + proc_cnt;
|
||||||
for (; proc_ptr < proc_end; proc_ptr++)
|
for (; proc_ptr < proc_end; proc_ptr++)
|
||||||
{
|
{
|
||||||
|
symbolS *adr_sym;
|
||||||
unsigned long adr;
|
unsigned long adr;
|
||||||
|
|
||||||
adr = bfd_asymbol_value (proc_ptr->sym->as_sym->bsym);
|
adr_sym = proc_ptr->sym->as_sym;
|
||||||
|
adr = (S_GET_VALUE (adr_sym)
|
||||||
|
+ bfd_get_section_vma (stdoutput,
|
||||||
|
S_GET_SEGMENT (adr_sym)));
|
||||||
if (first)
|
if (first)
|
||||||
{
|
{
|
||||||
if (first_fil)
|
if (first_fil)
|
||||||
@ -4499,7 +4524,7 @@ ecoff_frob_file ()
|
|||||||
|
|
||||||
cur_file_ptr = sym->ecoff_file;
|
cur_file_ptr = sym->ecoff_file;
|
||||||
add_ecoff_symbol ((const char *) NULL, st_Nil, sc_Nil, sym,
|
add_ecoff_symbol ((const char *) NULL, st_Nil, sc_Nil, sym,
|
||||||
bfd_asymbol_value (sym->bsym), indexNil);
|
S_GET_VALUE (sym), indexNil);
|
||||||
}
|
}
|
||||||
cur_proc_ptr = hold_proc_ptr;
|
cur_proc_ptr = hold_proc_ptr;
|
||||||
cur_file_ptr = hold_file_ptr;
|
cur_file_ptr = hold_file_ptr;
|
||||||
|
Reference in New Issue
Block a user