Commit Graph

15 Commits

Author SHA1 Message Date
Bruce Evans
1d47f58a3d Garbage-collected __ELF__ ifdefs.
Fixed some style bugs (mainly unused includes).
2002-09-15 22:28:39 +00:00
Bruce Evans
2ac73c2ce3 Don't use the ELF symbol type to summarily reject symbols in
X_db_search_symbol().  Otherwise we don't see important symbols in
non-verbosely written assembler code.

NetBSD already has this.  The kld version already has a stronger form
of it without really trying -- linker_ddb_search_symbol() doesn't
support ddb's symbol search strategy parameter, so the kld
X_db_search_symbol() doesn't pass the parameter to linker_ddb...() and
linker_ddb...() doesn't make distinctions based on the symbol type.

db_elf.c now works better than db_kld.c when it works (which is essentially
when there are no modules except the kernel).  It works after booting
with -d.  db_kld.c doesn't work until lots of SYSINIT()s have run.
2002-09-15 22:17:40 +00:00
Bruce Evans
abd368f09a Made this work on i386's at least. It wants ELF section headers for
symbol table sections.  Reconstruct the necessary section headers from
(ksym_start, ksym_end).  This was much easier than converting to use
module metadata, and just works for static symbols, unlike db_kld when
there is no module metadata.  Initialize (ksym_start, ksym_end) from
bootinfo on i386's only.

The boot loader should load section headers for all sections that it
loads, and apparently did this for at least the symbol table sections
when this file last worked under FreeBSD (on alphas only) and always
did this under NetBSD (where this file was obtained from).  At least
on i386's, boot2 discards the section headers (except for converting
them to (bootinfo.bi_symtab, bootinfo.bi_esymtab), and as far as I can
tell, loader(8) discards them apart from converting them to the bootinfo
values and module metadata.
2002-09-15 21:49:13 +00:00
Bruce Evans
f05c39e9d5 Made this compile (but not work). This involved mainly const poisoning
and renaming ALIGNED_POINTER() to _ALIGNED_POINTER() plus the following
hacks for i386's:
- define _ALIGNED_POINTER() if it is not already defined.  Most non-i386
  arches define it <machine/param.h> define it in <machine/param.h>,
  although none actually used it in the kernel.
- define ksym_start and ksym_end.  Most non-i386 arches still define and
  initialize these in machdep.c although they didn't used them.  Here is
  a better place to define them but not to initialize them.
2002-09-15 20:48:08 +00:00
Peter Wemm
160554fbf4 Remove a couple of __P() stragglers. 2002-06-29 02:32:34 +00:00
Bruce Evans
7085e70878 Reconnect db_elf.c to the build (now under "options DDB_NOKLDSYM"). It
doesn't actually build yet.
2002-05-07 10:59:52 +00:00
Bruce Evans
5eb6f4bc21 Restored db_elf.c from the Attic. This will be used for a quick fix for
the longstanding brokenness of symbols in ddb at boot time.  It doesn't
compile and is not attached to the build yet.
2002-05-06 00:05:44 +00:00
Peter Wemm
5dfaebe1c3 Unused file. This (NetBSD derived) file was obsoleted by kld. 2000-01-11 13:29:10 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Matthew Dillon
fe08c21a53 Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile.

    This commit includes significant work to proper handle const arguments
    for the DDB symbol routines.
1999-01-27 23:45:44 +00:00
Matthew Dillon
a1c1e16ada Changes to support -Wall, -Wcast-qual. Had to make physical code changes
in db_lookup() to avoid the *cp = 0 / *cp = ':' combo ( temporary
    nul-terminate-then-restore-original ) on a const char * string.
1999-01-27 19:00:49 +00:00
Peter Wemm
286896fe56 At the moment, the alpha tentatively uses the ddb elf code rather than KLD,
because the alpha boot loader hasn't been converted yet, and because
it needs the full symbol tables with local symbols in order to make sense
of stack tracebacks.  KLD will implement this (using full sybmol table
rather than the globals only) shortly.
1998-10-09 23:32:03 +00:00
Doug Rabson
bcf270989f Update to work with the new elf headers. 1998-08-17 08:06:31 +00:00
Doug Rabson
c2e7b2e40f Forgot to mention:
Obtained from: NetBSD
1998-06-28 00:59:26 +00:00
Doug Rabson
0282b90962 Add DDB symbol support for ELF and KLD. The KLD support only supports global
symbols so its not too useful.  Changes to the kernel linker to allow it to
supply DDB with symbols will come later.
1998-06-28 00:57:28 +00:00