Comment 3 for bug 1763050

Revision history for this message
Thomas Preud'homme (thomas-preudhomme) wrote :

Hi,

the LDR r0, =cst construct lets the assembler create a literal pool. However since GCC can create its own using in an inline asm can lead to some conflicts between the two and the construct is really aimed at full assembly file instead. Beside there is not much the assembler can do to alleviate the offset issue.

Instead I would suggest to use something like:

asm volatile ("ldr r1, [%0]" :: "r" (0xE000ED88) : "r1", "memory");

Or if you don't care about which register the load is made into:

int output;
sm volatile ("ldr %1, [%0]" : "=r" (output) : "r" (0xE000ED88) : "memory");

Best regards.