Skip to content

Commit 7f00a97

Browse files
Merge patch series "riscv: vdso.lds.S: some improvement"
Jisheng Zhang <[email protected]> says: This series renews one of my last year RFC patch[1], tries to improve the vdso layout a bit. patch1 removes useless symbols patch2 merges .data section of vdso into .rodata because they are readonly patch3 is the real renew patch, it removes hardcoded 0x800 .text start addr. But I rewrite the commit msg per Andrew's suggestions and move move .note, .eh_frame_hdr, and .eh_frame between .rodata and .text to keep the actual code well away from the non-instruction data. * b4-shazam-merge: riscv: vdso.lds.S: remove hardcoded 0x800 .text start addr riscv: vdso.lds.S: merge .data section into .rodata section riscv: vdso.lds.S: drop __alt_start and __alt_end symbols Link: https://lore.kernel.org/linux-riscv/[email protected]/ [1] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
2 parents b8a03a6 + 8f8c1ff commit 7f00a97

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

arch/riscv/kernel/vdso/vdso.lds.S

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,35 +23,31 @@ SECTIONS
2323
.gnu.version_d : { *(.gnu.version_d) }
2424
.gnu.version_r : { *(.gnu.version_r) }
2525

26-
.note : { *(.note.*) } :text :note
2726
.dynamic : { *(.dynamic) } :text :dynamic
2827

28+
.rodata : {
29+
*(.rodata .rodata.* .gnu.linkonce.r.*)
30+
*(.got.plt) *(.got)
31+
*(.data .data.* .gnu.linkonce.d.*)
32+
*(.dynbss)
33+
*(.bss .bss.* .gnu.linkonce.b.*)
34+
}
35+
36+
.note : { *(.note.*) } :text :note
37+
2938
.eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
3039
.eh_frame : { KEEP (*(.eh_frame)) } :text
3140

32-
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
33-
3441
/*
35-
* This linker script is used both with -r and with -shared.
36-
* For the layouts to match, we need to skip more than enough
37-
* space for the dynamic symbol table, etc. If this amount is
38-
* insufficient, ld -shared will error; simply increase it here.
42+
* Text is well-separated from actual data: there's plenty of
43+
* stuff that isn't used at runtime in between.
3944
*/
40-
. = 0x800;
45+
. = ALIGN(16);
4146
.text : { *(.text .text.*) } :text
4247

4348
. = ALIGN(4);
4449
.alternative : {
45-
__alt_start = .;
4650
*(.alternative)
47-
__alt_end = .;
48-
}
49-
50-
.data : {
51-
*(.got.plt) *(.got)
52-
*(.data .data.* .gnu.linkonce.d.*)
53-
*(.dynbss)
54-
*(.bss .bss.* .gnu.linkonce.b.*)
5551
}
5652
}
5753

0 commit comments

Comments
 (0)