Skip to content

Commit

Permalink
Ensure .text.start comes first in code binaries.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Smith authored and Steven Smith committed Feb 18, 2016
1 parent d951ed3 commit 088ef48
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common/payload_stage1.ld
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ SECTIONS
} >ram = 0xff
.plt : { *(.plt) } >ram = 0xff

.text.start : /* ALIGN (4): */
{
*(.text.start)
. = ALIGN(4); /* REQUIRED. LD is flaky without it. */
} >ram = 0xff

.text : /* ALIGN (4): */
{
*(.text .stub .text.* .gnu.linkonce.t.*)
Expand Down
6 changes: 6 additions & 0 deletions common/payload_stage2.ld
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ SECTIONS
} >ram = 0xff
.plt : { *(.plt) } >ram = 0xff

.text.start : /* ALIGN (4): */
{
*(.text.start)
. = ALIGN(4); /* REQUIRED. LD is flaky without it. */
} >ram = 0xff

.text : /* ALIGN (4): */
{
*(.text .stub .text.* .gnu.linkonce.t.*)
Expand Down
6 changes: 6 additions & 0 deletions payload_installer/installer/bootstrap.ld
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ SECTIONS
} >ram = 0xff
.plt : { *(.plt) } >ram = 0xff

.text.start : /* ALIGN (4): */
{
*(.text.start)
. = ALIGN(4); /* REQUIRED. LD is flaky without it. */
} >ram = 0xff

.text : /* ALIGN (4): */
{
*(.text .stub .text.* .gnu.linkonce.t.*)
Expand Down

0 comments on commit 088ef48

Please sign in to comment.