Skip to content

Commit 3bfb722

Browse files
David Daneyralfbaechle
authored andcommitted
MIPS: OCTEON: omit ELF NOTE segments
OCTEON Pre-SDK-1.8.1 bootloaders can not handle PT_NOTE program headers, so do not emit them. Before the patch: $ readelf --program-headers octeon-vmlinux Elf file type is EXEC (Executable file) Entry point 0xffffffff815d09d0 There are 2 program headers, starting at offset 64 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flags Align LOAD 0x0000000000001000 0xffffffff81100000 0xffffffff81100000 0x0000000000b57f80 0x0000000001b86360 RWE 1000 NOTE 0x00000000004e02e0 0xffffffff815df2e0 0xffffffff815df2e0 0x0000000000000024 0x0000000000000024 R 4 After the patch: $ readelf --program-headers octeon-vmlinux Elf file type is EXEC (Executable file) Entry point 0xffffffff815d09d0 There are 1 program headers, starting at offset 64 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flags Align LOAD 0x0000000000001000 0xffffffff81100000 0xffffffff81100000 0x0000000000b57f80 0x0000000001b86360 RWE 1000 The patch was tested on DSR-1000N router. Signed-off-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Cc: Matthew Fortune <Matthew.Fortune@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/11403/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 6137987 commit 3bfb722

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

arch/mips/kernel/vmlinux.lds.S

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ OUTPUT_ARCH(mips)
1717
ENTRY(kernel_entry)
1818
PHDRS {
1919
text PT_LOAD FLAGS(7); /* RWX */
20+
#ifndef CONFIG_CAVIUM_OCTEON_SOC
2021
note PT_NOTE FLAGS(4); /* R__ */
22+
#endif /* CAVIUM_OCTEON_SOC */
2123
}
2224

2325
#ifdef CONFIG_32BIT
@@ -71,7 +73,12 @@ SECTIONS
7173
__stop___dbe_table = .;
7274
}
7375

74-
NOTES :text :note
76+
#ifdef CONFIG_CAVIUM_OCTEON_SOC
77+
#define NOTES_HEADER
78+
#else /* CONFIG_CAVIUM_OCTEON_SOC */
79+
#define NOTES_HEADER :note
80+
#endif /* CONFIG_CAVIUM_OCTEON_SOC */
81+
NOTES :text NOTES_HEADER
7582
.dummy : { *(.dummy) } :text
7683

7784
_sdata = .; /* Start of data section */

0 commit comments

Comments
 (0)