summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1997-11-28 19:34:27 +0000
committerjdp <jdp@FreeBSD.org>1997-11-28 19:34:27 +0000
commit81c1440f4f7b69e385d76c2447b4940fd6494e2e (patch)
tree329a353a3e6f4b6a54ff004605b4f3e770486092 /gnu
parent944609b233daf2f62a50389113df6b7e452b9430 (diff)
downloadFreeBSD-src-81c1440f4f7b69e385d76c2447b4940fd6494e2e.zip
FreeBSD-src-81c1440f4f7b69e385d76c2447b4940fd6494e2e.tar.gz
In the "ldd -v" output, display the N_AUX information for each
symbol. It indicates whether the symbol refers to a function or a data object.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/ld/ldd/sods.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/gnu/usr.bin/ld/ldd/sods.c b/gnu/usr.bin/ld/ldd/sods.c
index d55a2de..3e28746 100644
--- a/gnu/usr.bin/ld/ldd/sods.c
+++ b/gnu/usr.bin/ld/ldd/sods.c
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sods.c,v 1.4 1997/02/22 15:46:44 peter Exp $
+ * $Id: sods.c,v 1.5 1997/09/02 21:54:39 jdp Exp $
*/
#include <assert.h>
@@ -435,6 +435,7 @@ static void
dump_sym(const struct nlist *np)
{
char type[8];
+ char aux[8];
char weak;
char *p;
@@ -479,16 +480,25 @@ dump_sym(const struct nlist *np)
case N_ECOMM: strcpy(type, "ecomm"); break;
case N_ECOML: strcpy(type, "ecoml"); break;
case N_LENG: strcpy(type, "leng"); break;
- default: snprintf(type, sizeof type, "0x%02x", np->n_type);
+ default:
+ snprintf(type, sizeof type, "%#02x", np->n_type);
+ break;
}
if (np->n_type & N_EXT && type[0] != '0')
for (p = type; *p != '\0'; ++p)
*p = toupper(*p);
+ switch (N_AUX(np)) {
+ case 0: strcpy(aux, ""); break;
+ case AUX_OBJECT: strcpy(aux, "objt"); break;
+ case AUX_FUNC: strcpy(aux, "func"); break;
+ default: snprintf(aux, sizeof aux, "%#01x", N_AUX(np)); break;
+ }
+
weak = N_BIND(np) == BIND_WEAK ? 'w' : ' ';
- printf("%c%-5s %8lx", weak, type, np->n_value);
+ printf("%c%-6s %-4s %8lx", weak, type, aux, np->n_value);
}
static void
OpenPOWER on IntegriCloud