Commit 3bfb7224 authored by David Daney's avatar David Daney Committed by Ralf Baechle

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: default avatarDavid Daney <ddaney@caviumnetworks.com>
Signed-off-by: default avatarAaro 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: default avatarRalf Baechle <ralf@linux-mips.org>
parent 61379878
...@@ -17,7 +17,9 @@ OUTPUT_ARCH(mips) ...@@ -17,7 +17,9 @@ OUTPUT_ARCH(mips)
ENTRY(kernel_entry) ENTRY(kernel_entry)
PHDRS { PHDRS {
text PT_LOAD FLAGS(7); /* RWX */ text PT_LOAD FLAGS(7); /* RWX */
#ifndef CONFIG_CAVIUM_OCTEON_SOC
note PT_NOTE FLAGS(4); /* R__ */ note PT_NOTE FLAGS(4); /* R__ */
#endif /* CAVIUM_OCTEON_SOC */
} }
#ifdef CONFIG_32BIT #ifdef CONFIG_32BIT
...@@ -71,7 +73,12 @@ SECTIONS ...@@ -71,7 +73,12 @@ SECTIONS
__stop___dbe_table = .; __stop___dbe_table = .;
} }
NOTES :text :note #ifdef CONFIG_CAVIUM_OCTEON_SOC
#define NOTES_HEADER
#else /* CONFIG_CAVIUM_OCTEON_SOC */
#define NOTES_HEADER :note
#endif /* CONFIG_CAVIUM_OCTEON_SOC */
NOTES :text NOTES_HEADER
.dummy : { *(.dummy) } :text .dummy : { *(.dummy) } :text
_sdata = .; /* Start of data section */ _sdata = .; /* Start of data section */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment