************************************************************************/
#include "defs.h"
-#include "elf/common.h"
-#include "elf/external.h"
-#include "elf/internal.h"
#include "bfd.h"
#include "libbfd.h" /* For bfd_elf_find_section */
+#include "libelf.h"
#include "symtab.h"
#include "symfile.h"
#include "objfiles.h"
if ((sym -> flags & (BSF_GLOBAL | BSF_WEAK))
&& (sym -> section != NULL))
{
- symaddr = sym -> value;
+ /* Bfd symbols are section relative. */
+ symaddr = sym -> value + sym -> section -> vma;
/* Relocate all non-absolute symbols by base address. */
if (sym -> section != &bfd_abs_section)
symaddr += addr;
continue; /* Skip this symbol. */
}
/* Pass symbol size field in via BFD. FIXME!!! */
- record_minimal_symbol_and_info ((char *) sym -> name,
- symaddr, ms_type, sym->udata, objfile);
+ {
+ elf32_symbol_type *esym = (elf32_symbol_type *) sym;
+ unsigned long size = esym->internal_elf_sym.st_size;
+ record_minimal_symbol_and_info ((char *) sym -> name, symaddr,
+ ms_type, (PTR) size, objfile);
+ }
}
/* See if this is a debugging symbol that helps Solaris
if (sectinfo->sections[index])
complain (§ion_info_dup_complaint, sectinfo->filename);
- symaddr = sym -> value;
+ /* Bfd symbols are section relative. */
+ symaddr = sym -> value + sym -> section -> vma;
/* Relocate all non-absolute symbols by base address. */
if (sym -> section != &bfd_abs_section)
symaddr += addr;
sections visible to the caller. So we have to search the
ELF section table, not the BFD section table, for the string
table. */
- struct elf_internal_shdr *elf_sect;
+ struct elf32_internal_shdr *elf_sect;
- elf_sect = bfd_elf_find_section (abfd, ".stabstr");
+ elf_sect = bfd_elf32_find_section (abfd, ".stabstr");
if (elf_sect)
elfstab_build_psymtabs (objfile,
section_offsets,