File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ __declspec(allocate(".project")) volatile MCCapsuleInfo MCcapsule = {};
105105#define PAYLOAD_SECTION_NAME " .payload"
106106#define PROJECT_SECTION_NAME " .project"
107107
108- extern MCCapsuleInfo MCpayload, MCcapsule;
108+ extern volatile MCCapsuleInfo MCpayload, MCcapsule;
109109asm (" .section .payload, \" aw\" , \" nobits\" ; .global MCpayload; MCpayload: .align 16; .space 16;" );
110110asm (" .section .project, \" aw\" , \" nobits\" ; .global MCcapsule; MCcapsule: .align 16; .space 16;" );
111111
@@ -263,6 +263,11 @@ class MCInternalPayloadOpen: public MCStatement
263263 }
264264 }
265265#else
266+ // Force references to the payload and project sections to prevent
267+ // extra-clever optimising linkers from discarding the sections.
268+ (void )MCpayload.size ;
269+ (void )MCcapsule.size ;
270+
266271 // Search for the payload section - first see if there is a payload
267272 // section of suitable size; then if in debug mode, try to load a stack
268273 // via env var.
You can’t perform that action at this time.
0 commit comments