You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Low-Fat Pointers protect global variables by using a custom linker script which ensures that their addresses fulfill alignment and size conditions. For custom linker sections, the linker seems to have a mechanism to determine which attributes the memory this section is assigned to has to have. In case some variables are constant, the linker might determine that the memory is only allocatable, but not writable.
The MemInstrument Low-Fat implementation distinguishes between constant and non-constant global variables (based on attributes), and assigns different sections to them. However, in some cases, the constantness is only determined after the MemInstrument pass by other analyses. This leads to constant and non-constant global variables having the same section assigned. Now the linker seems to decide that this mixed section should be assigned to not-writable memory, and the execution of the code terminates with a segmentation fault.
Behavior
Custom linker sections which contain mixed constant and non-constant global variables might end up being read-only.
Expected Behavior
Custom linker sections which contain mixed constant and non-constant global variables should be writable.
Additional Resources
We wrote a stack overflow question with MWE on how we can influence the behavior of the linker, without having to fully write a custom linker script.
The text was updated successfully, but these errors were encountered:
Problem
Low-Fat Pointers protect global variables by using a custom linker script which ensures that their addresses fulfill alignment and size conditions. For custom linker sections, the linker seems to have a mechanism to determine which attributes the memory this section is assigned to has to have. In case some variables are constant, the linker might determine that the memory is only allocatable, but not writable.
The MemInstrument Low-Fat implementation distinguishes between constant and non-constant global variables (based on attributes), and assigns different sections to them. However, in some cases, the constantness is only determined after the MemInstrument pass by other analyses. This leads to constant and non-constant global variables having the same section assigned. Now the linker seems to decide that this mixed section should be assigned to not-writable memory, and the execution of the code terminates with a segmentation fault.
Behavior
Custom linker sections which contain mixed constant and non-constant global variables might end up being read-only.
Expected Behavior
Custom linker sections which contain mixed constant and non-constant global variables should be writable.
Additional Resources
We wrote a stack overflow question with MWE on how we can influence the behavior of the linker, without having to fully write a custom linker script.
The text was updated successfully, but these errors were encountered: