Skip to content

Commit 5f424ef

Browse files
committed
Add another footnote
1 parent 54993f2 commit 5f424ef

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

content/post/orphan_sections_linker.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ where in memory does this section go?
6565
This is where things break down. Multiple linkers exhibit different behavior,
6666
and the rules seem to be pretty complex, depending on whether any PHDRS have
6767
been explicitly declared, and whether any MEMORY nodes are present in the linker
68-
script.
68+
script.[^1]
6969

7070
For a long time, the issue went unnoticed since the section was placed in RAM, which was the
7171
intended behavior. However, at some point, the section was placed in FLASH instead, causing the
@@ -227,7 +227,7 @@ section is allocated, has the right size of 0.
227227
## How can we make the linker script more robust?
228228

229229
After finding this issue, I looked for a way to detect this kind of problem,
230-
ideally at compile-time. I found the `--orphaned-handling` flag of the `ld` and `lld` linkers[^1].
230+
ideally at compile-time. I found the `--orphaned-handling` flag of the `ld` and `lld` linkers[^2].
231231
This flag allows us to specify what should be the behavior when an orphaned
232232
section is encountered. You have the following options:
233233

@@ -280,5 +280,9 @@ to your linker script.
280280
}
281281
```
282282

283-
[^1]: You can find the ld documentation for orphaned sections
283+
[^1]: MaskRay has a great [article](https://maskray.me/blog/2024-06-02-understanding-orphan-sections)
284+
describing some of these placement rules for both ld and lld, if you would like to go deeper into
285+
this topic.
286+
287+
[^2]: You can find the ld documentation for orphaned sections
284288
[here](https://sourceware.org/binutils/docs/ld/Orphan-Sections.html).

0 commit comments

Comments
 (0)