nm.c (302408) | nm.c (317623) |
---|---|
1/*- 2 * Copyright (c) 2007 Hyogeol Lee <hyogeollee@gmail.com> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 34 unchanged lines hidden (view full) --- 43#include <stdio.h> 44#include <stdlib.h> 45#include <string.h> 46#include <strings.h> 47#include <unistd.h> 48 49#include "_elftc.h" 50 | 1/*- 2 * Copyright (c) 2007 Hyogeol Lee <hyogeollee@gmail.com> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 34 unchanged lines hidden (view full) --- 43#include <stdio.h> 44#include <stdlib.h> 45#include <string.h> 46#include <strings.h> 47#include <unistd.h> 48 49#include "_elftc.h" 50 |
51ELFTC_VCSID("$Id: nm.c 3472 2016-05-17 20:11:16Z emaste $"); | 51ELFTC_VCSID("$Id: nm.c 3504 2016-12-17 15:33:16Z kaiwang27 $"); |
52 53/* symbol information list */ 54STAILQ_HEAD(sym_head, sym_entry); 55 56struct sym_entry { 57 char *name; 58 GElf_Sym *sym; 59 STAILQ_ENTRY(sym_entry) sym_entries; --- 1121 unchanged lines hidden (view full) --- 1181 if (kind == ELF_K_AR) { 1182 if ((arhdr = elf_getarhdr(elf)) == NULL) 1183 goto next_cmd; 1184 objname = arhdr->ar_name != NULL ? arhdr->ar_name : 1185 arhdr->ar_rawname; 1186 } 1187 if (!elf_getshnum(elf, &shnum)) { 1188 if ((e_err = elf_errno()) != 0) | 52 53/* symbol information list */ 54STAILQ_HEAD(sym_head, sym_entry); 55 56struct sym_entry { 57 char *name; 58 GElf_Sym *sym; 59 STAILQ_ENTRY(sym_entry) sym_entries; --- 1121 unchanged lines hidden (view full) --- 1181 if (kind == ELF_K_AR) { 1182 if ((arhdr = elf_getarhdr(elf)) == NULL) 1183 goto next_cmd; 1184 objname = arhdr->ar_name != NULL ? arhdr->ar_name : 1185 arhdr->ar_rawname; 1186 } 1187 if (!elf_getshnum(elf, &shnum)) { 1188 if ((e_err = elf_errno()) != 0) |
1189 warnx("%s: %s", OBJNAME, elf_errmsg(e_err)); | 1189 warnx("%s: %s", OBJNAME, "File format not recognized"); |
1190 else 1191 warnx("%s: cannot get section number", OBJNAME); 1192 rtn = 1; 1193 goto next_cmd; 1194 } 1195 if (shnum == 0) { 1196 warnx("%s: has no section", OBJNAME); 1197 rtn = 1; --- 923 unchanged lines hidden --- | 1190 else 1191 warnx("%s: cannot get section number", OBJNAME); 1192 rtn = 1; 1193 goto next_cmd; 1194 } 1195 if (shnum == 0) { 1196 warnx("%s: has no section", OBJNAME); 1197 rtn = 1; --- 923 unchanged lines hidden --- |