From 663d1da1e68b15397c00d6a094f78c2cf08358ea Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 22 Apr 2016 02:00:04 +0200 Subject: scripts/trylink: document DATA_SEGMENT_ALIGN() hack Signed-off-by: Denys Vlasenko --- scripts/trylink | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'scripts/trylink') diff --git a/scripts/trylink b/scripts/trylink index 15435f009..129570a60 100755 --- a/scripts/trylink +++ b/scripts/trylink @@ -209,6 +209,16 @@ else # *(.bss SORT_BY_ALIGNMENT(.bss.*) .gnu.linkonce.b.*) # This will eliminate most of the padding (~3kb). # Hmm, "ld --sort-section alignment" should do it too. + # + # There is a ld hack which is meant to decrease disk usage + # at the cost of more RAM usage (??!!) in standard ld script: + # /* Adjust the address for the data segment. We want to adjust up to + # the same address within the page on the next page up. */ + # . = ALIGN (0x1000) - ((0x1000 - .) & (0x1000 - 1)); . = DATA_SEGMENT_ALIGN (0x1000, 0x1000); + # Replace it with: + # . = ALIGN (0x1000); . = DATA_SEGMENT_ALIGN (0x1000, 0x1000); + # to unconditionally align .data to the next page boundary, + # instead of "next page, plus current offset in this page" try $CC $CFLAGS $LDFLAGS \ -o $EXE \ $SORT_COMMON \ -- cgit v1.2.3