Commit: --rosegment: Restore alignment of text segment
Checks
Commit Message
Hi Guys,
*sigh* I have found another snafu with my --rosegment feature.
I had disabled the alignment of the text segment in the on-disk
image, on the assumption that the loader would be able to load
a partial page into memory. In turns out however that this is
not correct, and that data following the text segment in the
on-disk image can be loaded into the executable segment in
memory.
So I am checking in this patch to restore the alignment of the
text segment in the on-disk image. Which means that the file
size increase when using '-z separate-code' is not alleviated
as much. (It can still be slightly improved since --rosegment
reduces the number of data segments).
Cheers
Nick
@@ -372,7 +372,7 @@ if test -z "$TINY_READONLY_SECTION"; then
*ro*textonly*)
ALL_TEXT_BEFORE_RO=" "
SEPARATE_TEXT=" "
- TEXT_SEGMENT_ALIGN=
+ TEXT_SEGMENT_ALIGN=". = ALIGN(${MAXPAGESIZE});"
;;
*textonly*)
SEPARATE_TEXT=" "