decompals / ido-static-recomp

IDO static recomp
43 stars 10 forks source link

Fix qsort #36

Closed simonlindholm closed 2 years ago

simonlindholm commented 2 years ago

I messed up the implementation, forgetting that qsort actually needed to be able to access the memory of the pointers you pass it... This fixes an ld segfault.

AngheloAlf commented 2 years ago

Do you have any steps to recreate the segfault?

simonlindholm commented 2 years ago

It was something like compile

int glob2;
void foo2(void) {
    glob2 = 1;
}

with IDO and then link it, I don't remember if -KPIC vs -non_shared mattered. I think any large enough binary should fail: it will crash as long as the sort call makes at least one reordering.