xtensa: drop unused sections and remapped reset handlers
authorMax Filippov <jcmvbkbc@gmail.com>
Fri, 16 Oct 2015 15:30:37 +0000 (18:30 +0300)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 3 Nov 2015 14:19:39 +0000 (17:19 +0300)
There are no .bootstrap or .ResetVector.text sections linked to the
vmlinux image, drop these sections from vmlinux.ld.S. Drop
RESET_VECTOR_VADDR definition only used for .ResetVector.text.

Drop remapped copies of primary and secondary reset vectors, as modern
gdb don't have problems stepping through instructions at arbitrary
locations. Drop corresponding sections from the corresponding linker
scripts.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/boot/boot-elf/boot.lds.S
arch/xtensa/boot/boot-elf/bootstrap.S
arch/xtensa/include/asm/vectors.h
arch/xtensa/kernel/mxhead.S
arch/xtensa/kernel/vmlinux.lds.S

index 958b33a..e54f2c9 100644 (file)
@@ -40,17 +40,4 @@ SECTIONS
                *(.bss)
                __bss_end = .;
        }
-
-#ifdef CONFIG_MMU
-       /*
-        * This is a remapped copy of the Reset Vector Code.
-        * It keeps gdb in sync with the PC after switching
-        * to the temporary mapping used while setting up
-        * the V2 MMU mappings for Linux.
-        */
-       .ResetVector.remapped_text 0x46000000 (INFO):
-       {
-               *(.ResetVector.remapped_text)
-       }
-#endif
 }
index 9341a57..e6bf313 100644 (file)
@@ -58,8 +58,6 @@ _SetupMMU:
        wsr     a0, ps
        rsync
 
-       Offset = _SetupMMU - _ResetVector
-
 #ifndef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
        initialize_mmu
 #endif
@@ -74,29 +72,3 @@ reset:
        movi    a3, 0
        movi    a4, 0
        jx      a0
-
-#ifdef CONFIG_MMU
-       .align 4
-
-       .section        .ResetVector.remapped_text, "x"
-       .global         _RemappedResetVector
-
-       /* Do org before literals */
-       .org 0
-
-_RemappedResetVector:
-       .begin  no-absolute-literals
-       .literal_position
-
-       _j      _RemappedSetupMMU
-
-       /* Position Remapped code at the same location as the original code */
-       . = _RemappedResetVector + Offset
-
-_RemappedSetupMMU:
-#ifndef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
-       initialize_mmu
-#endif
-
-       .end    no-absolute-literals
-#endif
index d3e6d2e..288c776 100644 (file)
@@ -85,10 +85,6 @@ static inline unsigned long xtensa_get_kio_paddr(void)
 /* Used to set VECBASE register */
 #define VECBASE_RESET_VADDR            VIRTUAL_MEMORY_ADDRESS
 
-#define RESET_VECTOR_VECOFS            (XCHAL_RESET_VECTOR_VADDR - \
-                                               VECBASE_RESET_VADDR)
-#define RESET_VECTOR_VADDR             XC_VADDR(RESET_VECTOR_VECOFS)
-
 #if defined(XCHAL_HAVE_VECBASE) && XCHAL_HAVE_VECBASE
 
 #define USER_VECTOR_VADDR              XC_VADDR(XCHAL_USER_VECOFS)
index 77a161a..9f38437 100644 (file)
@@ -48,8 +48,6 @@ _SetupOCD:
        rsync
 
 _SetupMMU:
-       Offset = _SetupMMU - _SecondaryResetVector
-
 #ifdef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
        initialize_mmu
 #endif
@@ -62,24 +60,3 @@ _SetupMMU:
        jx      a3
 
        .end    no-absolute-literals
-
-
-       .section        .SecondaryResetVector.remapped_text, "ax"
-       .global         _RemappedSecondaryResetVector
-
-       .org 0                                  # Need to do org before literals
-
-_RemappedSecondaryResetVector:
-       .begin  no-absolute-literals
-       .literal_position
-
-       _j      _RemappedSetupMMU
-       . = _RemappedSecondaryResetVector + Offset
-
-_RemappedSetupMMU:
-
-#ifdef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
-       initialize_mmu
-#endif
-
-       .end    no-absolute-literals
index d66cd40..c417cbe 100644 (file)
@@ -298,31 +298,6 @@ SECTIONS
 
   _end = .;
 
-  /* only used by the boot loader  */
-
-  . = ALIGN(0x10);
-  .bootstrap : { *(.bootstrap.literal .bootstrap.text .bootstrap.data) }
-
-  .ResetVector.text RESET_VECTOR_VADDR :
-  {
-    *(.ResetVector.text)
-  }
-
-
-  /*
-   * This is a remapped copy of the Secondary Reset Vector Code.
-   * It keeps gdb in sync with the PC after switching
-   * to the temporary mapping used while setting up
-   * the V2 MMU mappings for Linux.
-   *
-   * Only debug information about this section is put in the kernel image.
-   */
-  .SecondaryResetVector.remapped_text 0x46000000 (INFO):
-  {
-       *(.SecondaryResetVector.remapped_text)
-  }
-
-
   .xt.lit : { *(.xt.lit) }
   .xt.prop : { *(.xt.prop) }