• Russell King's avatar
    ARM: Fix XIP kernels · 2a381106
    Russell King authored
    Commit 7619751f ("ARM: 8595/2: apply more __ro_after_init") caused
    a regression with XIP kernels by moving the __ro_after_init data into
    the read-only section.  With XIP kernels, the read-only section is
    located in read-only memory from the very beginning.
    
    Work around this by moving the __ro_after_init data back into the .data
    section, which will be in RAM, and hence will be writable.
    
    It should be noted that in doing so, this remains writable after init.
    
    Fixes: 7619751f ("ARM: 8595/2: apply more __ro_after_init")
    Reported-by: default avatarAndrea Merello <andrea.merello@gmail.com>
    Tested-by: Andrea Merello <andrea.merello@gmail.com> [ XIP stm32 ]
    Tested-by: default avatarAlexandre Torgue <alexandre.torgue@st.com>
    Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
    2a381106
vmlinux-xip.lds.S 6.68 KB