The main difference is removed the c preprocessor flag entirely.
The relocation works in non-PIC mode nonetheless; the original idea was to separate them to allow non-PIC mode having more efficient code.
But on the second thought, the performance gain is probably too small to justify the confusion of code.
---
The patch reused the c macro ASSIGN_CURRENT_THREAD (and its family) for monitor.c to fix its problem.
The relocation fix is pretty standard relocation: using adrp+ldr to load the address of current_thread in the global object table (GOT), which is a table for address of global variables, so use another ldr to dereference it.
The relocation fix is addressing to bugs that only observed on arm64 and PIC mode (compiling to shared memory).
Updated version of the patch.
The main difference is removed the c preprocessor flag entirely.
The relocation works in non-PIC mode nonetheless; the original idea was to separate them to allow non-PIC mode having more efficient code.
But on the second thought, the performance gain is probably too small to justify the confusion of code.
---
The patch reused the c macro ASSIGN_ CURRENT_ THREAD (and its family) for monitor.c to fix its problem.
The relocation fix is pretty standard relocation: using adrp+ldr to load the address of current_thread in the global object table (GOT), which is a table for address of global variables, so use another ldr to dereference it.
The relocation fix is addressing to bugs that only observed on arm64 and PIC mode (compiling to shared memory).