mirror of
https://github.com/void-linux/void-packages.git
synced 2025-07-29 17:02:56 +02:00
uftrace: fix i686.
This commit is contained in:
parent
5b0dce898d
commit
4e1f2688ea
1 changed files with 44 additions and 0 deletions
44
srcpkgs/uftrace/patches/i686.patch
Normal file
44
srcpkgs/uftrace/patches/i686.patch
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
--- uftrace-0.9/arch/i386/mcount-dynamic.c.orig
|
||||||
|
+++ uftrace-0.9/arch/i386/mcount-dynamic.c
|
||||||
|
@@ -22,11 +22,11 @@
|
||||||
|
size_t trampoline_size = 16;
|
||||||
|
|
||||||
|
/* find unused 16-byte at the end of the code segment */
|
||||||
|
- mdi->trampoline = ALIGN(mdi->addr + mdi->size, PAGE_SIZE) - trampoline_size;
|
||||||
|
+ mdi->trampoline = ALIGN(mdi->text_addr + mdi->text_size, PAGE_SIZE) - trampoline_size;
|
||||||
|
|
||||||
|
- if (unlikely(mdi->trampoline < mdi->addr + mdi->size)) {
|
||||||
|
+ if (unlikely(mdi->trampoline < mdi->text_addr + mdi->text_size)) {
|
||||||
|
mdi->trampoline += trampoline_size;
|
||||||
|
- mdi->size += PAGE_SIZE;
|
||||||
|
+ mdi->text_size += PAGE_SIZE;
|
||||||
|
|
||||||
|
pr_dbg2("adding a page for fentry trampoline at %#lx\n",
|
||||||
|
mdi->trampoline);
|
||||||
|
@@ -35,7 +35,7 @@
|
||||||
|
MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (mprotect((void *)mdi->addr, mdi->size, PROT_READ | PROT_WRITE)) {
|
||||||
|
+ if (mprotect((void *)mdi->text_addr, mdi->text_size, PROT_READ | PROT_WRITE)) {
|
||||||
|
pr_dbg("cannot setup trampoline due to protection: %m\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
@@ -49,7 +49,7 @@
|
||||||
|
|
||||||
|
void mcount_cleanup_trampoline(struct mcount_dynamic_info *mdi)
|
||||||
|
{
|
||||||
|
- if (mprotect((void *)mdi->addr, mdi->size, PROT_EXEC))
|
||||||
|
+ if (mprotect((void *)mdi->text_addr, mdi->text_size, PROT_EXEC))
|
||||||
|
pr_err("cannot restore trampoline due to protection");
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -58,7 +58,7 @@
|
||||||
|
static unsigned long get_target_addr(struct mcount_dynamic_info *mdi, unsigned long addr)
|
||||||
|
{
|
||||||
|
while (mdi) {
|
||||||
|
- if (mdi->addr <= addr && addr < mdi->addr + mdi->size)
|
||||||
|
+ if (mdi->text_addr <= addr && addr < mdi->text_addr + mdi->text_size)
|
||||||
|
return mdi->trampoline - (addr + CALL_INSN_SIZE);
|
||||||
|
|
||||||
|
mdi = mdi->next;
|
Loading…
Add table
Reference in a new issue