Commit Graph

45 Commits

Author SHA1 Message Date
kientzle
308e8489e1 Clarify a warning message. 2012-10-29 03:31:22 +00:00
eadler
1edc5fff53 Remove variables which are initialized but never used thereafter reported by gcc46 warning
Approved by:	cperciva
MFC After:	3 days
2012-06-19 06:10:34 +00:00
uqs
14cd39e1d0 Reencode files to UTF-8. Drop CP1252 em-dash. 2011-12-30 00:59:08 +00:00
nwhitehorn
02bb2a078e Repair some build breakage introduced in r211725 and garbage collect some
code made obsolete in the same commit.
2010-08-28 15:03:11 +00:00
imp
c3a399c4ba MFtbemd:
Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want
to test of all the CPUs of a given family conform.
2010-08-23 22:24:11 +00:00
luigi
4b9cd1c90f various cleanups including:
+ check a possible buffer overflow when creating a temp file,
  submitted by Christoph Mallon
+ remove stale struct definitions
+ clarify the use of dflag and remove useless checks

MFC after:	3 days
2009-01-06 14:23:38 +00:00
luigi
e7aa89bb16 fix a couple of innocuous compiler warnings
MFC after:	3 days
2009-01-06 14:21:17 +00:00
luigi
d71ad1411f correct description of how a string is stored, fix a few
typos and reference the kernel file which processes this info.

All in all, the content of this file should be moved to kldxref.c
or to the kld(4) manpage.

MFC after:	3 days
2009-01-06 14:10:30 +00:00
luigi
d3ad4d216f Make the linker.hints file have mode 644 instead of 600.
There is nothing secret in the file, and the missing read
permission breaks diskless operation.

MFC after:	4 weeks
2008-11-30 14:20:08 +00:00
jb
5582e69034 These are the things that the tinderbox has problems with because it
doesn't use the default CFLAGS which contain -fno-strict-aliasing.

Until the code is cleaned up, just add -fno-strict-aliasing to the
CFLAGS of these for the tinderboxes' sake, allowing the rest of the
tree to have -Werror enabled again.
2007-11-20 02:07:30 +00:00
imp
9ae554a06e Use safe strlcpy rather than unsafe strncpy. After marcel's last fix,
there was still one overflow possible.  strlcpy is faster anyway
because it doesn't unexpectedly zero the entire length of the string
when copying short strings....
2006-08-05 18:22:11 +00:00
marcel
1152880ccd Build shared on PowerPC now that the bug has been found and fixed. 2006-08-04 21:29:39 +00:00
marcel
5fae7020fe Fix (static) buffer overflow bug. The dest buffer is of size MAXPATHLEN,
so dest[MAXPATHLEN] falls outside the buffer.  This bug corrupted
arenas[0] defined in libc's malloc.c on PowerPC when kldxref is shared,
which triggered a delayed SIGSERV.
2006-08-04 21:28:42 +00:00
marcel
037932ab72 Use NO_SHARED=YES to force a static link.
Pointed out by: ru@
2006-07-30 20:51:41 +00:00
marcel
390d60b0cb Link kldxref(8) static on PowerPC to work around a SIGSEGV that
cannot easily be analyzed due to there being no debugger yet.
The SIGSEGV only happens when kldxref is linked shared.
Since kldxref(8) is needed for a release build, having it not
dump core is important.
2006-07-29 19:43:26 +00:00
marcel
152e76d1d1 Change maketempfile() to return a FILE* so as to eliminate the fopen()
that immediately follows the only call to it. maketempfile() uses
mkstemp(), so the temporary file has already been opened and using
fopen() again just opens the file twice. This also fixes the invalid
mode used on the fopen().
While here, assign NULL to fxref after fclose() because we test for
fxref being !NULL to determine if we have the (temporary) hints file
open.
2006-07-29 19:39:03 +00:00
jasone
6abe8a1c87 Use posix_memalign() rather than assuming that malloc() provides adequate
alignment.

Approved by:	markm (mentor)
2006-01-12 08:01:38 +00:00
marcel
0a081d09f4 Make our ELF64 type definitions match standards. In particular this
means:
o  Remove Elf64_Quarter,
o  Redefine Elf64_Half to be 16-bit,
o  Redefine Elf64_Word to be 32-bit,
o  Add Elf64_Xword and Elf64_Sxword for 64-bit entities,
o  Use Elf_Size in MI code to abstract the difference between
   Elf32_Word and Elf64_Word.
o  Add Elf_Ssize as the signed counterpart of Elf_Size.

MFC after: 2 weeks
2005-12-18 04:52:37 +00:00
marcel
3394701ae1 Explicitly cast ELF_R_TYPE() to the right type. 2005-12-18 01:38:26 +00:00
ru
c5eba8bfee Skip .symbols files. 2005-11-11 08:13:18 +00:00
grehan
b3557d5c4d Doh, erase unused variable... 2005-03-03 06:38:00 +00:00
grehan
9cbbd424d8 PowerPC support for kldxref by handling the PPC-specific relocations. 2005-03-02 12:27:42 +00:00
iedowse
d0d1e68e58 Explicitly pass in the relocation base and data offset into ef_reloc()
rather than relying on a trick that happens to work for the current
relocation schemes. Also add some comments and improve variable
naming.
2004-08-28 19:31:10 +00:00
iedowse
d29d728a27 Use a temporary void * variable to work around a strict aliasing
warning that gcc generates at -O2 and higher.
2004-08-27 08:54:40 +00:00
iedowse
3fe1377c6a Add MD relocation support for amd64 and i386 platforms. The no-op
relocation is not sufficient for ELF relocatable object format
modules, since accessing the module metadata involves following
pointers between different ELF sections.

This allows kldxref to correctly build linker.hints on the amd64
platform.
2004-08-27 01:06:57 +00:00
iedowse
c3e1384b73 Add support for reading ELF relocatable object file format modules. 2004-08-27 00:58:40 +00:00
iedowse
ca4083743c Call the file format specific code through a table of function
pointers and remove knowledge of the file format from kldxref.c.
This will make it possible to support more than one file format.
2004-08-27 00:51:21 +00:00
ru
63d9df2be5 Fixed manpage's synopsis, and synchronized it with the program's usage(). 2004-06-01 09:34:04 +00:00
sobomax
1c5fa3c156 Check that specified in the command line path is actually a directory,
otherwise we are risking to coredump later on.
2004-04-30 00:20:58 +00:00
des
4c7061da8c Remove bogus (void **) casts. This unbreaks the -O2 build. 2004-03-15 17:43:36 +00:00
des
42f562f3a8 I don't normally use my middle name, so remove it from attributions in
man pages (though not from copyright notices).  While I'm here, add email
addresses where appropriate.
2004-01-25 11:39:42 +00:00
obrien
a920d12f89 style.Makefile(5) 2003-04-04 17:49:21 +00:00
ru
bc6ef60e0e 3rd party modules live in /boot/modules nowadays. 2003-03-03 22:49:21 +00:00
jake
af44b94319 Fix kldxref on sparc64 by allowing non-trivial relocations to be performed
on variables read out of raw kld files.  Unlike other platforms the value
will be in an Elf_Rela, not in the data section of the elf file.

Submitted by:	Hartmut Brandt <brandt@fokus.gmd.de>
PR:		46730
Tested on:	alpha (obrien), i386, sparc64
2003-01-21 03:51:53 +00:00
peter
f9fc595091 This is a userland tool, not a kernel component or libstand client. 2002-07-17 23:41:58 +00:00
charnier
d2168fe021 The .Nm utility 2002-07-14 14:47:15 +00:00
des
4d6b787d2d Usage style sweep: spell "usage" with a small 'u'.
Also change one case of blatant __progname abuse (several more remain)
This commit does not touch anything in src/{contrib,crypto,gnu}/.
2002-04-22 13:44:47 +00:00
peter
961ff64e43 Make kldxref work for Elf64 (which has 32 bit hash tables) 2002-04-11 09:30:15 +00:00
jhb
b0ee025908 Remove unnecessary machine/bootinfo.h includes.
Submitted by:	jake
2002-01-03 19:10:49 +00:00
mikeh
e408e50776 Reorder WARNS line for style.
Pointed out by:	bde
2001-12-10 21:13:36 +00:00
mikeh
41747ff124 WARNS=2 cleanup.
PR:		bin/32567
MFC after:	2 weeks
2001-12-09 07:22:26 +00:00
ru
57f082bf43 mdoc(7) police: oops, didn't catch this one without ispell(1). 2001-11-22 12:08:35 +00:00
ru
eea089732d mdoc(7) police: tiny markup fixes. 2001-11-22 12:03:31 +00:00
des
591edbb022 Write a real man page. 2001-10-12 02:06:34 +00:00
peter
2975fbf1b3 Add kldxref(8), for maintaining the linker.hints file for translating
module->pathname.ko.  It supports only ELF for now.

Submitted by:   bp  (with some minor tweaks)
2001-09-11 01:13:15 +00:00