Files
elk/src/stab-coff.c
T
sam d51c970c8d elk (3.0-9) unstable; urgency=low
* New maintainer.
  * Packaging updates:
    + Fixed spelling in the package description (Closes: #161056).
    + Updated standards version to 3.5.9.0.
    + Changed SCM_DIR from /usr/lib/elk/scm to /usr/share/elk/scm because
      scheme scripts are platform-independent.
  * Massive code cleanups:
    + Added -Wall to the build rules to make error spotting easier, and fixed
      all compilation warnings in the main program.
    + Replaced sys_errlist with strerror, bcopy with memcpy, bzero with memset.
    + Fixed many uninitialized variables.
  * Fixed some pointer/integer type confusions which caused elk to crash
    on alpha (Closes: #59893) and probably ia64.
  * Fixed a read overflow in heap-gen.c:AllocPage() that was corrupting the
    internal heap (Closes: #57621).
  * Fixed a missing memory area initialization in heap-gen.c:ExpandHeap() that
    was causing garbage collector crashes.
  * Fixed an integer sign issue in main.c:Max_Stack (Closes: #176190).
  * Made `quit' an alias for `exit' in toplevel.scm.
 -- Samuel Hocevar <sam@zoy.org>  Tue,  1 Apr 2003 11:33:23 +0200


git-svn-id: svn://svn.zoy.org/elk/trunk@3 55e467fa-43c5-0310-a8a2-de718669efc6
2003-08-19 19:24:23 +00:00

54 lines
1.2 KiB
C

#include <filehdr.h>
#include <syms.h>
#undef TYPE /* ldfnc.h defines a TYPE macro. */
#include <ldfcn.h>
SYMTAB *Snarf_Symbols (LDFILE *lf, int ep) {
SYMTAB *tab;
register SYM *sp, **nextp;
SYMENT sym;
long inx;
char *p;
extern char *ldgetname();
if (ldtbseek (lf) == FAILURE) {
ldclose (lf);
Primitive_Error ("can't ldtbseek");
}
tab = (SYMTAB *)Safe_Malloc (sizeof (SYMTAB));
tab->first = 0;
tab->strings = 0;
nextp = &tab->first;
while (1) {
inx = ldtbindex (lf);
if (ldtbread (lf, inx, &sym) == FAILURE)
break;
if (sym.n_scnum == N_UNDEF || sym.n_scnum == N_DEBUG
|| sym.n_scnum > HEADER(lf).f_nscns || sym.n_sclass != C_EXT)
continue;
if ((p = ldgetname (lf, &sym)) == NULL)
continue;
sp = (SYM *)Safe_Malloc (sizeof (SYM));
sp->name = Safe_Malloc (strlen (p) + 1);
strcpy (sp->name, p);
sp->value = sym.n_value;
*nextp = sp;
nextp = &sp->next;
*nextp = 0;
}
return tab;
}
#ifdef INIT_OBJECTS
SYMTAB *Open_File_And_Snarf_Symbols (char *name) {
LDFILE *f;
SYMTAB *tab;
if ((f = ldopen (name, NULL)) == FAILURE)
Primitive_Error ("can't ldopen a.out file");
tab = Snarf_Symbols (f);
ldclose (f);
return tab;
}
#endif /* INIT_OBJECTS */