Deleted Added
full compact
nm.c (280932) nm.c (300311)
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 3179 2015-03-31 19:38:56Z emaste $");
51ELFTC_VCSID("$Id: nm.c 3472 2016-05-17 20:11:16Z emaste $");
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;

--- 725 unchanged lines hidden (view full) ---

785 ".line",
786 ".rel.debug",
787 ".rela.debug",
788 ".stab",
789 NULL
790 };
791 const char **p;
792
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;

--- 725 unchanged lines hidden (view full) ---

785 ".line",
786 ".rel.debug",
787 ".rela.debug",
788 ".stab",
789 NULL
790 };
791 const char **p;
792
793 assert(shname != NULL && "shname is NULL");
793 if (shname == NULL)
794 return (false);
794
795 for (p = dbg_sec; *p; p++) {
796 if (!strncmp(shname, *p, strlen(*p)))
797 return (true);
798 }
799
800 return (false);
801}

--- 909 unchanged lines hidden (view full) ---

1711
1712 case STT_HIPROC:
1713 printf("%18s|", "HIPROC");
1714 break;
1715
1716 case STT_NOTYPE:
1717 default:
1718 printf("%18s|", "NOTYPE");
795
796 for (p = dbg_sec; *p; p++) {
797 if (!strncmp(shname, *p, strlen(*p)))
798 return (true);
799 }
800
801 return (false);
802}

--- 909 unchanged lines hidden (view full) ---

1712
1713 case STT_HIPROC:
1714 printf("%18s|", "HIPROC");
1715 break;
1716
1717 case STT_NOTYPE:
1718 default:
1719 printf("%18s|", "NOTYPE");
1719 };
1720 }
1720
1721 if (sym->st_size != 0)
1722 nm_opts.size_print_fn(sym);
1723 else
1724 printf(" ");
1725
1726 printf("| |%s", sec);
1727}

--- 212 unchanged lines hidden (view full) ---

1940 /* HIRESERVE or XINDEX */
1941 sec = "*HIRESERVE*";
1942 break;
1943 default:
1944 if (ep->sym->st_shndx > p->sh_num)
1945 return;
1946 sec = p->s_table[ep->sym->st_shndx];
1947 break;
1721
1722 if (sym->st_size != 0)
1723 nm_opts.size_print_fn(sym);
1724 else
1725 printf(" ");
1726
1727 printf("| |%s", sec);
1728}

--- 212 unchanged lines hidden (view full) ---

1941 /* HIRESERVE or XINDEX */
1942 sec = "*HIRESERVE*";
1943 break;
1944 default:
1945 if (ep->sym->st_shndx > p->sh_num)
1946 return;
1947 sec = p->s_table[ep->sym->st_shndx];
1948 break;
1948 };
1949 }
1949
1950 nm_opts.elem_print_fn(type, sec, ep->sym, ep->name);
1951
1952 if (nm_opts.debug_line == true && !IS_UNDEF_SYM_TYPE(type))
1953 print_lineno(ep, func_info, var_info, line_info);
1954
1955 printf("\n");
1956}

--- 163 unchanged lines hidden ---
1950
1951 nm_opts.elem_print_fn(type, sec, ep->sym, ep->name);
1952
1953 if (nm_opts.debug_line == true && !IS_UNDEF_SYM_TYPE(type))
1954 print_lineno(ep, func_info, var_info, line_info);
1955
1956 printf("\n");
1957}

--- 163 unchanged lines hidden ---