proc_sym.c (0bbf2702963a2fe6f7bb025d5d07ee4195856b8f) proc_sym.c (af3c78886fd8d4ca5eebdbe581a459a6f6d29d6a)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2016-2017 Mark Johnston <markj@FreeBSD.org>
5 * Copyright (c) 2010 The FreeBSD Foundation
6 * Copyright (c) 2008 John Birrell (jb@freebsd.org)
7 * All rights reserved.
8 *

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

100}
101
102struct symsort_thunk {
103 Elf *e;
104 struct symtab *symtab;
105};
106
107static int
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2016-2017 Mark Johnston <markj@FreeBSD.org>
5 * Copyright (c) 2010 The FreeBSD Foundation
6 * Copyright (c) 2008 John Birrell (jb@freebsd.org)
7 * All rights reserved.
8 *

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

100}
101
102struct symsort_thunk {
103 Elf *e;
104 struct symtab *symtab;
105};
106
107static int
108symvalcmp(void *_thunk, const void *a1, const void *a2)
108symvalcmp(const void *a1, const void *a2, void *_thunk)
109{
110 GElf_Sym sym1, sym2;
111 struct symsort_thunk *thunk;
112 const char *s1, *s2;
113 u_int i1, i2;
114 int bind1, bind2;
115
116 i1 = *(const u_int *)a1;

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

187 return (-1);
188 for (u_int i = 0; i < nsyms; i++)
189 symtab->index[i] = i;
190 symtab->nsyms = nsyms;
191 symtab->stridx = shdr.sh_link;
192
193 thunk.e = e;
194 thunk.symtab = symtab;
109{
110 GElf_Sym sym1, sym2;
111 struct symsort_thunk *thunk;
112 const char *s1, *s2;
113 u_int i1, i2;
114 int bind1, bind2;
115
116 i1 = *(const u_int *)a1;

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

187 return (-1);
188 for (u_int i = 0; i < nsyms; i++)
189 symtab->index[i] = i;
190 symtab->nsyms = nsyms;
191 symtab->stridx = shdr.sh_link;
192
193 thunk.e = e;
194 thunk.symtab = symtab;
195 qsort_r(symtab->index, nsyms, sizeof(u_int), &thunk, symvalcmp);
195 qsort_r(symtab->index, nsyms, sizeof(u_int), symvalcmp, &thunk);
196
197 return (0);
198}
199
200static void
201load_symtabs(struct file_info *file)
202{
203

--- 514 unchanged lines hidden ---
196
197 return (0);
198}
199
200static void
201load_symtabs(struct file_info *file)
202{
203

--- 514 unchanged lines hidden ---