mailing list of musl libc
 help / color / mirror / code / Atom feed
8ba9f30a55abf7752a0004fb9abec21319b3104c blob 1022 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
 
#define _GNU_SOURCE
#include <link.h>
#include <stdint.h>

typedef uintptr_t _Unwind_Ptr;

struct find_exidx_data {
	_Unwind_Ptr pc, exidx_start;
	int exidx_len;
};

static int find_exidx(struct dl_phdr_info *info, size_t size, void *ptr)
{
	struct find_exidx_data *data = ptr;
	const ElfW(Phdr) *phdr = info->dlpi_phdr;
	_Unwind_Ptr addr, exidx_start = 0;
	int i, match = 0, exidx_len = 0;

	for (i = info->dlpi_phnum; i > 0; i--, phdr++) {
		addr = info->dlpi_addr + phdr->p_vaddr;
		switch (phdr->p_type) {
		case PT_LOAD:
			match |= data->pc >= addr && data->pc < addr + phdr->p_memsz;
			break;
		case PT_ARM_EXIDX:
			exidx_start = addr;
			exidx_len = phdr->p_memsz;
			break;
		}
	}
	if (match) {
		data->exidx_start = exidx_start;
		data->exidx_len = exidx_len;
	}
	return match;
}

_Unwind_Ptr __gnu_Unwind_Find_exidx(_Unwind_Ptr pc, int *pcount)
{
	struct find_exidx_data data;
	data.pc = pc;
	if (dl_iterate_phdr(find_exidx, &data) <= 0)
		return 0;
	*pcount = data.exidx_len / 8;
	return data.exidx_start;
}
debug log:

solving 8ba9f30 ...
found 8ba9f30 in https://inbox.vuxu.org/musl/1373481699-17888-1-git-send-email-timo.teras@iki.fi/

applying [1/1] https://inbox.vuxu.org/musl/1373481699-17888-1-git-send-email-timo.teras@iki.fi/
diff --git a/arch/arm/src/find_exidx.c b/arch/arm/src/find_exidx.c
new file mode 100644
index 0000000..8ba9f30

Checking patch arch/arm/src/find_exidx.c...
Applied patch arch/arm/src/find_exidx.c cleanly.

index at:
100644 8ba9f30a55abf7752a0004fb9abec21319b3104c	arch/arm/src/find_exidx.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).