gcc __attribute__ section not working?
It turns out I wasn't using the gcc attribute correctly. I was trying to place the variable directly into OCM using:

volatile u32 x __attribute__ ((section ("psu_ocm_ram_0_MEM_0"))) = 10;


as if the compiler is able to put individual variables into specific memory locations. Rather, it's the linker that's responsible for assigning all executable code (data and instructions) to physical memory. It order to make this work, I had to create a custom section in the linker script and assign this section to OCM:

.my_section : {
    KEEP(*(.my_section))
} &gt; psu_ocm_ram_0_MEM_0


Then in my code:

volatile u32 x __attribute__ ((section (".my_section"))) = 10;


The output was then:

x = 10
p = FFFC0000


as expected.