Skip to content

Commit

Permalink
riscv: move exception table immediately after RO_DATA
Browse files Browse the repository at this point in the history
Move EXCEPTION_TABLE immediately after RO_DATA. Make it easy to set the
attribution of the sections which should be read-only at a time.
Add _data to specify the start of data section with write permission.
This patch is prepared for STRICT_KERNEL_RWX support.

Signed-off-by: Zong Li <zong.li@sifive.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
  • Loading branch information
Zong Li authored and Palmer Dabbelt committed Mar 26, 2020
1 parent 5fde3db commit bd3d914
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/riscv/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ SECTIONS
*(.srodata*)
}

EXCEPTION_TABLE(0x10)

_data = .;

RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
.sdata : {
__global_pointer$ = . + 0x800;
Expand All @@ -68,8 +72,6 @@ SECTIONS

BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0)

EXCEPTION_TABLE(0x10)

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

0 comments on commit bd3d914

Please sign in to comment.