jmc
9490d37cb6
convert to new .Dd format;
2007-05-31 19:19:00 +00:00
miod
44579ce936
Fix a NULL dereference if the symbol table size is zero; ok millert@ deraadt@
2007-04-18 19:03:04 +00:00
ray
ee53977c97
Do all allocation and deallocation of shstr in elf_symload() to
...
prevent double-freeing shstr.
Also don't free known NULL values (*pnames and *psnames).
Initially inspired by Charles Longeau's first diff to tech@; he
later sent a second diff to tech@ nearly identical to this commit.
Freaky.
OK mickey@.
2007-02-08 03:50:49 +00:00
mickey
f6451fd341
check st_name validity also check for overflow and not only for zero; found by Charles Longeau <chl@tuxfamily.org>
2007-02-07 10:20:40 +00:00
kettenis
e588d87f2a
Some fixes for running nm on ELF binaries.
...
- Fix printing the symbol type of undefined symbols.
- Fall back onto the dynamic symbol table if the normal symbol table is not
available (i.e. if the binary has been stripped).
ok mickey@
2006-09-30 14:34:13 +00:00
grange
b6c79fe80b
Add elf{32,64}_load_phdrs() for loading program headers.
...
ok mickey@
2005-01-19 19:37:29 +00:00
espie
dd4fcf1d94
don't try to demangle C symbols if we're ELF.
...
looks okay mickey@
2005-01-03 14:49:39 +00:00
mickey
d9f1a75011
describe R type; found by matthieu@
2004-10-25 20:43:15 +00:00
mickey
e7baf1baaf
a few more xrefs
2004-10-11 05:57:13 +00:00
mickey
59111b5815
add rcisd[]
2004-10-11 04:50:47 +00:00
mickey
ef5759070b
now that no cpu assumptions are left in -- remove the cross-glue
2004-10-10 16:45:00 +00:00
mickey
2c48c29cef
parse the cpu-specific ids based on the e_machine
2004-10-10 16:41:18 +00:00
millert
e9fb207d65
My MMAP/MUNMAP macros are too simple to copyright so place this in the
...
public domain. OK mickey@
2004-10-09 22:11:11 +00:00
mickey
5b19ca8c08
move out elf code into elf.c and generate 32 and 64 versions of it;
...
allow operation on size-mixed host-target as well as ensianess for
both a.out and elf (though a.out 64bit probably does not exist ;)
tested on hppa-sparc64-i386-vax intermixen
2004-10-09 20:26:57 +00:00
mickey
e397383aa4
factor out code for mapping section index into nlist type
2004-10-09 20:17:52 +00:00
mickey
629deeacc5
grok STT_SECTION and beautify STT_OBJECT
2004-08-20 04:42:51 +00:00
mickey
529795ff24
STT_FUNC can be an absolute too
2004-08-19 19:23:08 +00:00
mjc
e51b6f8831
mention weak symbols
...
improvements and ok miod@
2004-07-19 09:16:55 +00:00
mickey
ad09d25472
need to byteswap string table size before use for the alien endian a.out
2004-07-11 07:08:46 +00:00
deraadt
fe0197a8ab
spacing
2004-05-04 23:09:07 +00:00
mickey
18752b6f19
dig .plt*, .got*, .init, .fini sections
2004-05-04 23:07:53 +00:00
miod
f02f175658
Correctly report empty a.out objects as "no name list" instead of "bad format".
...
ok mickey@ millert@
2004-04-29 13:34:37 +00:00
mickey
5e023417c9
no need to force N_EXT as deducted later from type
2004-03-30 15:35:51 +00:00
mickey
04fc15aeca
there is more than one way to define symbol type in elf...; kill a debugging printf too
2004-03-30 15:29:44 +00:00
mickey
00f0c9335f
translate names in .sbss section as static N_BSS; found by drahn@
2004-03-30 15:12:38 +00:00
jmc
f63e30b939
typo;
...
ok mickey@
2004-02-09 20:46:36 +00:00
deraadt
5141ee4ac9
knf; millert ok
2004-01-28 18:05:10 +00:00
millert
615c0a9908
Fix the mmap case; inadequate testing on my part!
2004-01-14 04:23:26 +00:00
millert
c80ae301aa
Fallback to malloc + pread if mmap fails; fixes "nm /dev/ksyms". OK mickey@
2004-01-14 02:52:04 +00:00
mickey
4423a46038
kill unused local vars; from deraadt@
2004-01-13 17:32:32 +00:00
jmc
4579cabdfc
man tweaks;
2004-01-06 09:19:16 +00:00
mickey
fd9f71a717
nm digs elf and merges w/ size; millert@ ok
2004-01-05 01:27:22 +00:00
mickey
ffaf84f12b
hppa is bigendian
2003-11-07 04:43:14 +00:00
deraadt
1837a5ca50
mostly ansi cleanup; pval ok
2003-06-10 22:20:44 +00:00
millert
f75387cb26
Remove the advertising clause in the UCB license which Berkeley
...
rescinded 22 July 1999. Proofed by myself and Theo.
2003-06-03 02:56:05 +00:00
deraadt
30fdd9d956
snprintf; ok miod ho henning
2003-04-05 17:15:06 +00:00
millert
c72b5b24e1
Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
2002-02-16 21:27:05 +00:00
mpech
c0932ef1ff
kill more registers
...
millert@ ok
2001-11-19 19:02:13 +00:00
espie
3586637570
Knowledge about sparc68/ppc endianess. Who knows where oldish a.out files
...
may come from ?
2001-08-19 23:21:40 +00:00
espie
2f445ff2ff
Some missing protos. Use macros from <link.h> instead of rolling our own.
2001-08-17 16:29:33 +00:00
espie
eea5467b8b
Show indirect symbols in -e mode.
2001-08-17 14:25:26 +00:00
espie
53ebdd03e3
-e switch, show extra symbol information such as weak symbol status.
2001-08-16 15:45:05 +00:00
fgsch
c025fd8b49
Add I for indirect reference (alias to other symbol).
2001-06-23 21:54:51 +00:00
millert
c18f6f7f57
Add -C flag to synopsis; Brian Poole <raj@cerias.purdue.edu>
2001-06-20 22:32:53 +00:00
smart
dacee8e75f
- remove erealloc() wrapper function
...
- standard function prototypes
- remove extraneous exit(1) after an err(1,...)
Shrinks source by 11 lines and executable by 22 bytes on i386. deraadt@ ok
2001-05-31 16:28:51 +00:00
smart
1c30938f8a
The 'file' argument is optional since if one is not given the programs
...
try a.out. deraadt@ ok
2001-05-30 16:58:39 +00:00
espie
e09803ec90
-C support.
...
Recognize -B, for better gnu-nm compatibility.
2001-02-18 21:45:09 +00:00
provos
fee881f600
seperate -> separate, okay aaron@
2000-11-10 15:33:02 +00:00
aaron
f1ba34738e
Change all option list specifications to ".Bl -tag -width Ds". Most man
...
pages just needed their -width parameter tweaked to "Ds", which provides
a nice width of 6 constant characters. For consistency more than anything.
2000-11-09 17:51:53 +00:00
aaron
21059b0f05
Various cleanups and standardization.
2000-03-10 19:07:20 +00:00
espie
b4dc42ce11
Fix -Wall warnings.
1999-08-29 17:22:05 +00:00
aaron
2e0eb34f9e
- remove trailing white space
...
- remove arguments from .Os macros
- remove arguments from .Nm macros, where appropriate
- some more Dq/Sq/Ql insanity
- still lots to do in the usr.bin tree... :/
1999-06-05 01:21:16 +00:00
espie
070a3e5900
Fixes endianess problems with old a.out tools. This makes building
...
some cross toolchains possible.
This also changes some utilities's behavior slightly:
- nm, strip, size now handle any a.out format they know about.
- ranlib complains if it detects mixed archives (several object
formats for different boxes).
In the presence of mixed objects, you still have file, ranlib or ld
to prevent you from getting too confused...
1999-05-10 16:14:07 +00:00
aaron
9e17188366
usr.bin/ man page cleanups, n-s
1998-09-27 16:57:47 +00:00
niklas
41c920a7be
Build nm ok for cross-envs
1998-05-11 20:34:54 +00:00
deraadt
e189ddde44
$OpenBSD$
1997-09-21 11:34:32 +00:00
deraadt
918be88687
warn instead of warnx; kleink
1997-05-31 08:26:19 +00:00
deraadt
bf8fee845d
check MID field like strip(1) does; PR#149, mickey; fix by me
1997-04-04 18:27:07 +00:00
millert
72799b18e5
getopt(3) returns -1 when out of args, not EOF, whee!
1997-01-15 23:40:20 +00:00
deraadt
1258a77d10
rcsid
1996-06-26 05:31:08 +00:00
deraadt
577cadfea7
from netbsd; Use err() & warn()
1996-01-16 00:57:11 +00:00
deraadt
df930be708
initial import of NetBSD tree
1995-10-18 08:37:01 +00:00