Skip to content

Commit a1254f1

Browse files
authored
Merge pull request #551 from dhalbert/3.0_double_word_stack_align
3.0 double word stack align
2 parents 5de29ac + efbf082 commit a1254f1

11 files changed

+21
-13
lines changed

extmod/modure.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ STATIC mp_obj_t re_split(size_t n_args, const mp_obj_t *args) {
144144
}
145145

146146
mp_obj_t retval = mp_obj_new_list(0, NULL);
147-
const char* caps[caps_num];
147+
const char **caps = alloca(caps_num * sizeof(char*));
148148
while (true) {
149149
// cast is a workaround for a bug in msvc: it treats const char** as a const pointer instead of a pointer to pointer to const char
150150
memset((char**)caps, 0, caps_num * sizeof(char*));

ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ MEMORY
1111
}
1212

1313
/* top end of the stack */
14-
_estack = ORIGIN(RAM) + LENGTH(RAM) - 4;
14+
/* stack must be double-word (8 byte) aligned */
15+
_estack = ORIGIN(RAM) + LENGTH(RAM) - 8;
1516
_bootloader_dbl_tap = _estack;
1617

1718
/* define output sections */

ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ MEMORY
1111
}
1212

1313
/* top end of the stack */
14-
_estack = ORIGIN(RAM) + LENGTH(RAM) - 4;
14+
/* stack must be double-word (8 byte) aligned */
15+
_estack = ORIGIN(RAM) + LENGTH(RAM) - 8;
1516
_bootloader_dbl_tap = _estack;
1617

1718
/* define output sections */

ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ MEMORY
1010
}
1111

1212
/* top end of the stack */
13-
_estack = ORIGIN(RAM) + LENGTH(RAM) - 4;
13+
/* stack must be double-word (8 byte) aligned */
14+
_estack = ORIGIN(RAM) + LENGTH(RAM) - 8;
1415
_bootloader_dbl_tap = _estack;
1516

1617
/* define output sections */

ports/atmel-samd/boards/samd21x18-bootloader.ld

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ MEMORY
1111
}
1212

1313
/* top end of the stack */
14-
_estack = ORIGIN(RAM) + LENGTH(RAM) - 4;
14+
/* stack must be double-word (8 byte) aligned */
15+
_estack = ORIGIN(RAM) + LENGTH(RAM) - 8;
1516
_bootloader_dbl_tap = _estack;
1617

1718
/* define output sections */

ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ MEMORY
1010
}
1111

1212
/* top end of the stack */
13-
_estack = ORIGIN(RAM) + LENGTH(RAM) - 4;
13+
/* stack must be double-word (8 byte) aligned */
14+
_estack = ORIGIN(RAM) + LENGTH(RAM) - 8;
1415
_bootloader_dbl_tap = _estack;
1516

1617
/* define output sections */

ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ MEMORY
1010
}
1111

1212
/* top end of the stack */
13-
_estack = ORIGIN(RAM) + LENGTH(RAM) - 4;
13+
/* stack must be double-word (8 byte) aligned */
14+
_estack = ORIGIN(RAM) + LENGTH(RAM) - 8;
1415
_bootloader_dbl_tap = _estack;
1516

1617
/* define output sections */

ports/atmel-samd/boards/samd51x19-bootloader.ld

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ MEMORY
1010
}
1111

1212
/* top end of the stack */
13-
_estack = ORIGIN(RAM) + LENGTH(RAM) - 4;
13+
/* stack must be double-word (8 byte) aligned */
14+
_estack = ORIGIN(RAM) + LENGTH(RAM) - 8;
1415
_bootloader_dbl_tap = _estack;
1516

1617
/* define output sections */

ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ MEMORY
1010
}
1111

1212
/* top end of the stack */
13-
_estack = ORIGIN(RAM) + LENGTH(RAM) - 4;
13+
/* stack must be double-word (8 byte) aligned */
14+
_estack = ORIGIN(RAM) + LENGTH(RAM) - 8;
1415
_bootloader_dbl_tap = _estack;
1516

1617
/* define output sections */

ports/atmel-samd/boards/samd51x20-bootloader.ld

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ MEMORY
1010
}
1111

1212
/* top end of the stack */
13-
_estack = ORIGIN(RAM) + LENGTH(RAM) - 4;
13+
/* stack must be double-word (8 byte) aligned */
14+
_estack = ORIGIN(RAM) + LENGTH(RAM) - 8;
1415
_bootloader_dbl_tap = _estack;
1516

1617
/* define output sections */

0 commit comments

Comments
 (0)