Skip to content

Commit

Permalink
Merge pull request #1111 from Qwinci/misc-fixes
Browse files Browse the repository at this point in the history
Fix relr relocations and match glibc behavior in frexp
  • Loading branch information
mintsuki authored Aug 20, 2024
2 parents f3e45ca + 7130c0e commit 2eded87
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions options/ansi/musl-generic-math/frexp.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ double frexp(double x, int *e)
} else *e = 0;
return x;
} else if (ee == 0x7ff) {
*e = 0;
return x;
}

Expand Down
1 change: 1 addition & 0 deletions options/ansi/musl-generic-math/frexpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ float frexpf(float x, int *e)
} else *e = 0;
return x;
} else if (ee == 0xff) {
*e = 0;
return x;
}

Expand Down
1 change: 1 addition & 0 deletions options/ansi/musl-generic-math/frexpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ long double frexpl(long double x, int *e)
} else *e = 0;
return x;
} else if (ee == 0x7fff) {
*e = 0;
return x;
}

Expand Down
1 change: 0 additions & 1 deletion options/rtld/generic/linker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1728,7 +1728,6 @@ void Loader::_processStaticRelocations(SharedObject *object) {
if(!(entry & 1)) {
addr = (elf_addr *)(object->baseAddress + entry);
__ensure(addr);
*addr++ += object->baseAddress;
}else {
// Odd entry indicates entry is a bitmap of the subsequent locations to be relocated.
for(int i = 0; entry; ++i) {
Expand Down
1 change: 0 additions & 1 deletion options/rtld/generic/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ extern "C" void relocateSelf() {
if(!(entry & 1)) {
addr = (elf_addr *)(ldso_base + entry);
__ensure(addr);
*addr++ += ldso_base;
}else {
// Odd entry indicates entry is a bitmap of the subsequent locations to be relocated.
for(int i = 0; entry; ++i) {
Expand Down

0 comments on commit 2eded87

Please sign in to comment.