* elfread.c (elf_symtab_read): Do not test BSF_GLOBAL for

procedure linkage table symbols, it is no longer set due to the
	Jan 6 BFD change in bfd/elfcode.h.
This commit is contained in:
Peter Schauer 1995-01-28 21:43:51 +00:00
parent fede999213
commit de537409fc
2 changed files with 34 additions and 29 deletions

View File

@ -1,3 +1,9 @@
Sat Jan 28 13:40:46 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* elfread.c (elf_symtab_read): Do not test BSF_GLOBAL for
procedure linkage table symbols, it is no longer set due to the
Jan 6 BFD change in bfd/elfcode.h.
Fri Jan 27 17:08:06 1995 Stan Shebs <shebs@andros.cygnus.com>
* top.c (use_windows): Clarify comments.

View File

@ -1,5 +1,5 @@
/* Read ELF (Executable and Linking Format) object files for GDB.
Copyright 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
Copyright 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support.
This file is part of GDB.
@ -300,13 +300,34 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
continue;
}
if (sym -> section == &bfd_und_section
&& (sym -> flags & BSF_FUNCTION))
{
/* Symbol is a reference to a function defined in
a shared library.
If its value is non zero then it is usually the address
of the corresponding entry in the procedure linkage table,
relative to the base address.
If its value is zero then the dynamic linker has to resolve
the symbol. We are unable to find any meaningful address
for this symbol in the executable file, so we skip it.
Irix 5 has a zero value for all shared library functions
in the main symbol table, but the dynamic symbol table
provides the right values. */
symaddr = sym -> value;
if (symaddr == 0)
continue;
symaddr += addr;
record_minimal_symbol_and_info ((char *) sym -> name, symaddr,
mst_solib_trampoline, NULL,
objfile);
continue;
}
/* If it is a nonstripped executable, do not enter dynamic
symbols, as the dynamic symbol table is usually a subset
of the main symbol table.
On Irix 5 however, the symbols for the procedure linkage
table entries have meaningful values only in the dynamic
symbol table, so we always examine undefined symbols. */
if (dynamic && !stripped && sym -> section != &bfd_und_section)
of the main symbol table. */
if (dynamic && !stripped)
continue;
if (sym -> flags & BSF_FILE)
{
@ -335,29 +356,7 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
/* For non-absolute symbols, use the type of the section
they are relative to, to intuit text/data. Bfd provides
no way of figuring this out for absolute symbols. */
if (sym -> section == &bfd_und_section
&& (sym -> flags & BSF_GLOBAL)
&& (sym -> flags & BSF_FUNCTION))
{
/* Symbol is a reference to a function defined in
a shared library.
If its value is non zero then it is usually the
absolute address of the corresponding entry in
the procedure linkage table.
If its value is zero then the dynamic linker has to
resolve the symbol. We are unable to find any
meaningful address for this symbol in the
executable file, so we skip it.
Irix 5 has a zero value for all shared library functions
in the main symbol table, but the dynamic symbol table
provides the right values. */
ms_type = mst_solib_trampoline;
symaddr = sym -> value;
if (symaddr == 0)
continue;
symaddr += addr;
}
else if (sym -> section == &bfd_abs_section)
if (sym -> section == &bfd_abs_section)
{
/* This is a hack to get the minimal symbol type
right for Irix 5, which has absolute adresses