Skip to content

Commit

Permalink
Revert "RISC-V: Make BSS section as the last section in vmlinux.lds.S"
Browse files Browse the repository at this point in the history
At least BBL relies on the flat binaries containing all the bytes in the
actual image to exist in the file.  Before this revert the flat images
dropped the trailing zeros, which caused BBL to put its copy of the
device tree where Linux thought the BSS was, which wreaks all sorts of
havoc.  Manifesting the bug is a bit subtle because BBL aligns
everything to 2MiB page boundaries, but with large enough kernels you're
almost certain to get bitten by the bug.

While moving the sections around isn't a great long-term fix, it will at
least avoid producing broken images.

This reverts commit 22e6a2e.

Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Palmer Dabbelt committed Feb 11, 2019
1 parent e3613bb commit 41fb9d5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions arch/riscv/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
#include <asm/cache.h>
#include <asm/thread_info.h>

#define MAX_BYTES_PER_LONG 0x10

OUTPUT_ARCH(riscv)
ENTRY(_start)

Expand Down Expand Up @@ -76,17 +74,15 @@ SECTIONS
*(.sbss*)
}

BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0)

EXCEPTION_TABLE(0x10)
NOTES

.rel.dyn : {
*(.rel.dyn*)
}

BSS_SECTION(MAX_BYTES_PER_LONG,
MAX_BYTES_PER_LONG,
MAX_BYTES_PER_LONG)

_end = .;

STABS_DEBUG
Expand Down

0 comments on commit 41fb9d5

Please sign in to comment.