Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: fusl/src/ldso/arm/find_exidx.c

Issue 1724903002: [fusl] Remove code for unsupported architectures (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fusl/src/ldso/arm/dlsym.s ('k') | fusl/src/ldso/i386/dlsym.s » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #define _GNU_SOURCE
2 #include <link.h>
3 #include <stdint.h>
4
5 struct find_exidx_data {
6 uintptr_t pc, exidx_start;
7 int exidx_len;
8 };
9
10 static int find_exidx(struct dl_phdr_info* info, size_t size, void* ptr) {
11 struct find_exidx_data* data = ptr;
12 const ElfW(Phdr)* phdr = info->dlpi_phdr;
13 uintptr_t addr, exidx_start = 0;
14 int i, match = 0, exidx_len = 0;
15
16 for (i = info->dlpi_phnum; i > 0; i--, phdr++) {
17 addr = info->dlpi_addr + phdr->p_vaddr;
18 switch (phdr->p_type) {
19 case PT_LOAD:
20 match |= data->pc >= addr && data->pc < addr + phdr->p_memsz;
21 break;
22 case PT_ARM_EXIDX:
23 exidx_start = addr;
24 exidx_len = phdr->p_memsz;
25 break;
26 }
27 }
28 data->exidx_start = exidx_start;
29 data->exidx_len = exidx_len;
30 return match;
31 }
32
33 uintptr_t __gnu_Unwind_Find_exidx(uintptr_t pc, int* pcount) {
34 struct find_exidx_data data;
35 data.pc = pc;
36 if (dl_iterate_phdr(find_exidx, &data) <= 0)
37 return 0;
38 *pcount = data.exidx_len / 8;
39 return data.exidx_start;
40 }
OLDNEW
« no previous file with comments | « fusl/src/ldso/arm/dlsym.s ('k') | fusl/src/ldso/i386/dlsym.s » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698