Fix bss size alignment in the assembler.

Relax the requirement in the linker as well.
This commit is contained in:
vak
2015-09-15 00:37:35 -07:00
parent 3db23e5d6a
commit dbd2d74487
2 changed files with 4 additions and 2 deletions

View File

@@ -2425,6 +2425,9 @@ void makeheader (rtsize, rdsize)
{ {
struct exec hdr; struct exec hdr;
/* Align BSS size. */
count[SBSS] = (count[SBSS] + WORDSZ-1) & ~(WORDSZ-1);
hdr.a_midmag = RMAGIC; hdr.a_midmag = RMAGIC;
hdr.a_text = count [STEXT]; hdr.a_text = count [STEXT];
hdr.a_data = count [SDATA] + count [SSTRNG]; hdr.a_data = count [SDATA] + count [SSTRNG];

View File

@@ -866,8 +866,7 @@ void readhdr (loc)
error (2, "bad length of text"); error (2, "bad length of text");
if (filhdr.a_data % W) if (filhdr.a_data % W)
error (2, "bad length of data"); error (2, "bad length of data");
if (filhdr.a_bss % W) /* BSS segment is allowed to be unaligned. */
error (2, "bad length of bss");
} }
/* /*