Skip to content
This repository was archived by the owner on Jan 24, 2022. It is now read-only.

Commit dd96aeb

Browse files
authored
Merge pull request #7 from whitequark/patch-1
Mark .debug_gdb_scripts as non-allocatable
2 parents ab919d0 + 72e8fd5 commit dd96aeb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

link.x

+11
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ SECTIONS
3535

3636
_sidata = LOADADDR(.data);
3737

38+
/* Due to an unfortunate combination of legacy concerns,
39+
toolchain drawbacks, and insufficient attention to detail,
40+
rustc has no choice but to mark .debug_gdb_scripts as allocatable.
41+
We really do not want to upload it to our target, so we
42+
remove the allocatable bit. Unfortunately, it appears
43+
that the only way to do this in a linker script is
44+
the extremely obscure "INFO" output section type specifier. */
45+
.debug_gdb_scripts 0 (INFO) : {
46+
KEEP(*(.debug_gdb_scripts))
47+
}
48+
3849
/DISCARD/ :
3950
{
4051
/* Unused unwinding stuff */

0 commit comments

Comments
 (0)