https://sourceware.org/bugzilla/show_bug.cgi?id=20475
whitequark at whitequark dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|FIXED |---
--- Comment #9 from whitequark at whitequark dot org ---
Reopening since further testing indicates that Alan's suggestion only worked
partially. My minimal testcase, as described in the first comment, works as
expected now, but the non-minimized one crashes, in a different way.
Specifically, it contains the rough equivalent of the following C code in Rust
(built as -fPIC as before):
struct fmt {
void (*fn)(void *arg);
void *arg;
}
void f() {
struct fmt x = {
.fn = h,
.arg = ...,
};
g(&x);
}
void g(struct fmt *x) {
x->fn(x->arg);
}
void h(void *arg);
The way it crashes is when calling x->fn(); it jumps into a garbage address.
It is not yet clear to me what is the root cause. However, I suspect that
R_OR1K_GOT16 is at fault, because pinning _GLOBAL_OFFSET_TABLE_ to the
beginning of .got as before makes the code work as expected.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-binutils