s390/boot: move all linker symbol declarations from c to h files
authorAlexander Egorenkov <egorenar@linux.ibm.com>
Wed, 30 Jun 2021 15:12:25 +0000 (17:12 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 27 Jul 2021 07:39:12 +0000 (09:39 +0200)
To prevent multiple incompatible declarations of symbols and to catch
such mistakes at compile time.

Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Acked-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/boot/boot.h
arch/s390/boot/compressed/decompressor.c
arch/s390/boot/compressed/decompressor.h
arch/s390/boot/pgm_check_info.c
arch/s390/boot/startup.c

index ae04e1c..937dbdd 100644 (file)
@@ -8,7 +8,7 @@
 
 #ifndef __ASSEMBLY__
 
-#include <linux/compiler.h>
+#include <asm/extable.h>
 
 void startup_kernel(void);
 unsigned long detect_memory(void);
@@ -22,11 +22,19 @@ void print_pgm_check_info(void);
 unsigned long get_random_base(unsigned long safe_addr);
 void __printf(1, 2) decompressor_printk(const char *fmt, ...);
 
+/* Symbols defined by linker scripts */
 extern const char kernel_version[];
 extern unsigned long memory_limit;
 extern unsigned long vmalloc_size;
 extern int vmalloc_size_set;
 extern int kaslr_enabled;
+extern char __boot_data_start[], __boot_data_end[];
+extern char __boot_data_preserved_start[], __boot_data_preserved_end[];
+extern char _sdma[], _edma[];
+extern char _stext_dma[], _etext_dma[];
+extern struct exception_table_entry _start_dma_ex_table[];
+extern struct exception_table_entry _stop_dma_ex_table[];
+extern char _decompressor_syms_start[], _decompressor_syms_end[];
 
 unsigned long read_ipl_report(unsigned long safe_offset);
 
index 37a4a8d..e27c214 100644 (file)
 #define memmove memmove
 #define memzero(s, n) memset((s), 0, (n))
 
-/* Symbols defined by linker scripts */
-extern char _end[];
-extern unsigned char _compressed_start[];
-extern unsigned char _compressed_end[];
-
 #ifdef CONFIG_KERNEL_BZIP2
 #define BOOT_HEAP_SIZE 0x400000
 #elif CONFIG_KERNEL_ZSTD
index 41f0ad9..a59f75c 100644 (file)
@@ -26,7 +26,12 @@ struct vmlinux_info {
        unsigned long rela_dyn_end;
 };
 
+/* Symbols defined by linker scripts */
+extern char _end[];
+extern unsigned char _compressed_start[];
+extern unsigned char _compressed_end[];
 extern char _vmlinux_info[];
+
 #define vmlinux (*(struct vmlinux_info *)_vmlinux_info)
 
 #endif /* BOOT_COMPRESSED_DECOMPRESSOR_H */
index 3a46abe..7126a1b 100644 (file)
@@ -29,7 +29,6 @@ static char *symstart(char *p)
        return p + 1;
 }
 
-extern char _decompressor_syms_start[], _decompressor_syms_end[];
 static noinline char *findsym(unsigned long ip, unsigned short *off, unsigned short *len)
 {
        /* symbol entries are in a form "10000 c4 startup\0" */
index d0cf216..793d159 100644 (file)
@@ -13,8 +13,6 @@
 #include "compressed/decompressor.h"
 #include "boot.h"
 
-extern char __boot_data_start[], __boot_data_end[];
-extern char __boot_data_preserved_start[], __boot_data_preserved_end[];
 unsigned long __bootdata_preserved(__kaslr_offset);
 unsigned long __bootdata_preserved(VMALLOC_START);
 unsigned long __bootdata_preserved(VMALLOC_END);
@@ -35,10 +33,6 @@ u64 __bootdata_preserved(alt_stfle_fac_list[16]);
  * over to the decompressed / relocated kernel via the .boot.preserved.data
  * section.
  */
-extern char _sdma[], _edma[];
-extern char _stext_dma[], _etext_dma[];
-extern struct exception_table_entry _start_dma_ex_table[];
-extern struct exception_table_entry _stop_dma_ex_table[];
 unsigned long __bootdata_preserved(__sdma) = __pa(&_sdma);
 unsigned long __bootdata_preserved(__edma) = __pa(&_edma);
 unsigned long __bootdata_preserved(__stext_dma) = __pa(&_stext_dma);