Skip to content

Make linker fill alignment gaps with bkpt instruction #1305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/rp2_common/pico_standard_link/memmap_default.ld
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ SECTIONS
*(.eh_frame*)
. = ALIGN(4);
} > FLASH
/* bkpt has opcode 0xBE and one (ignored) immediate parameter, which we set to 0xBE, giving us 0xBEBE */
= 0xBEBE

.rodata : {
*(EXCLUDE_FILE(*libgcc.a: *libc.a:*lib_a-mem*.o *libm.a:) .rodata*)
Expand Down Expand Up @@ -125,11 +127,13 @@ SECTIONS
__data_start__ = .;
*(vtable)

FILL(0xBEBE)
*(.time_critical*)

/* remaining .text and .rodata; i.e. stuff we exclude above because we want it in RAM */
*(.text*)
. = ALIGN(4);
FILL(0)
*(.rodata*)
. = ALIGN(4);

Expand Down