Quellcode durchsuchen

x86: Rename linker script symbols

Create more generic names for the symbols exported from the linker script
Graeme Russ vor 14 Jahren
Ursprung
Commit
067f9b1071
4 geänderte Dateien mit 33 neuen und 36 gelöschten Zeilen
  1. 7 7
      arch/i386/lib/bios_setup.c
  2. 10 10
      arch/i386/lib/board.c
  3. 7 7
      arch/i386/lib/realmode.c
  4. 9 12
      board/eNET/u-boot.lds

+ 7 - 7
arch/i386/lib/bios_setup.c

@@ -45,8 +45,8 @@ DECLARE_GLOBAL_DATA_PTR;
 #define BIOS_BASE        ((char*)0xf0000)
 #define BIOS_BASE        ((char*)0xf0000)
 #define BIOS_CS          0xf000
 #define BIOS_CS          0xf000
 
 
-extern ulong _i386boot_bios;
-extern ulong _i386boot_bios_size;
+extern ulong __bios_start;
+extern ulong __bios_size;
 
 
 /* these are defined in a 16bit segment and needs
 /* these are defined in a 16bit segment and needs
  * to be accessed with the RELOC_16_xxxx() macros below
  * to be accessed with the RELOC_16_xxxx() macros below
@@ -141,8 +141,8 @@ static void setvector(int vector, u16 segment, void *handler)
 
 
 int bios_setup(void)
 int bios_setup(void)
 {
 {
-	ulong i386boot_bios      = (ulong)&_i386boot_bios + gd->reloc_off;
-	ulong i386boot_bios_size = (ulong)&_i386boot_bios_size;
+	ulong bios_start = (ulong)&__bios_start + gd->reloc_off;
+	ulong bios_size = (ulong)&__bios_size;
 
 
 	static int done=0;
 	static int done=0;
 	int vector;
 	int vector;
@@ -154,13 +154,13 @@ int bios_setup(void)
 	}
 	}
 	done = 1;
 	done = 1;
 
 
-	if (i386boot_bios_size > 65536) {
+	if (bios_size > 65536) {
 		printf("BIOS too large (%ld bytes, max is 65536)\n",
 		printf("BIOS too large (%ld bytes, max is 65536)\n",
-		       i386boot_bios_size);
+		       bios_size);
 		return -1;
 		return -1;
 	}
 	}
 
 
-	memcpy(BIOS_BASE, (void*)i386boot_bios, i386boot_bios_size);
+	memcpy(BIOS_BASE, (void*)bios_start, bios_size);
 
 
 	/* clear bda */
 	/* clear bda */
 	memset(BIOS_DATA, 0, BIOS_DATA_SIZE);
 	memset(BIOS_DATA, 0, BIOS_DATA_SIZE);

+ 10 - 10
arch/i386/lib/board.c

@@ -48,11 +48,11 @@
 DECLARE_GLOBAL_DATA_PTR;
 DECLARE_GLOBAL_DATA_PTR;
 
 
 /* Exports from the Linker Script */
 /* Exports from the Linker Script */
-extern ulong _i386boot_text_start;
-extern ulong _i386boot_rel_dyn_start;
-extern ulong _i386boot_rel_dyn_end;
-extern ulong _i386boot_bss_start;
-extern ulong _i386boot_bss_size;
+extern ulong __text_start;
+extern ulong __rel_dyn_start;
+extern ulong __rel_dyn_end;
+extern ulong __bss_start;
+extern ulong __bss_size;
 
 
 const char version_string[] =
 const char version_string[] =
 	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")";
 	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")";
@@ -169,12 +169,12 @@ gd_t *gd;
  */
  */
 void board_init_f (ulong gdp)
 void board_init_f (ulong gdp)
 {
 {
-	void *text_start = &_i386boot_text_start;
+	void *text_start = &__text_start;
 	void *u_boot_cmd_end = &__u_boot_cmd_end;
 	void *u_boot_cmd_end = &__u_boot_cmd_end;
-	Elf32_Rel *rel_dyn_start = (Elf32_Rel *)&_i386boot_rel_dyn_start;
-	Elf32_Rel *rel_dyn_end = (Elf32_Rel *)&_i386boot_rel_dyn_end;
-	void *bss_start = &_i386boot_bss_start;
-	ulong bss_size = (ulong)&_i386boot_bss_size;
+	Elf32_Rel *rel_dyn_start = (Elf32_Rel *)&__rel_dyn_start;
+	Elf32_Rel *rel_dyn_end = (Elf32_Rel *)&__rel_dyn_end;
+	void *bss_start = &__bss_start;
+	ulong bss_size = (ulong)&__bss_size;
 
 
 	ulong uboot_size;
 	ulong uboot_size;
 	void *dest_addr;
 	void *dest_addr;

+ 7 - 7
arch/i386/lib/realmode.c

@@ -31,23 +31,23 @@
 #define REALMODE_MAILBOX ((char*)0xe00)
 #define REALMODE_MAILBOX ((char*)0xe00)
 
 
 
 
-extern ulong _i386boot_realmode;
-extern ulong _i386boot_realmode_size;
+extern ulong __realmode_start;
+extern ulong __realmode_size;
 extern char realmode_enter;
 extern char realmode_enter;
 
 
 int realmode_setup(void)
 int realmode_setup(void)
 {
 {
-	ulong i386boot_realmode      = (ulong)&_i386boot_realmode + gd->reloc_off;
-	ulong i386boot_realmode_size = (ulong)&_i386boot_realmode_size;
+	ulong realmode_start = (ulong)&__realmode_start + gd->reloc_off;
+	ulong realmode_size = (ulong)&__realmode_size;
 
 
 	/* copy the realmode switch code */
 	/* copy the realmode switch code */
-	if (i386boot_realmode_size > (REALMODE_MAILBOX-REALMODE_BASE)) {
+	if (realmode_size > (REALMODE_MAILBOX-REALMODE_BASE)) {
 		printf("realmode switch too large (%ld bytes, max is %d)\n",
 		printf("realmode switch too large (%ld bytes, max is %d)\n",
-		       i386boot_realmode_size, (REALMODE_MAILBOX-REALMODE_BASE));
+		       realmode_size, (REALMODE_MAILBOX-REALMODE_BASE));
 		return -1;
 		return -1;
 	}
 	}
 
 
-	memcpy(REALMODE_BASE, (void*)i386boot_realmode, i386boot_realmode_size);
+	memcpy(REALMODE_BASE, (void*)realmode_start, realmode_size);
 	asm("wbinvd\n");
 	asm("wbinvd\n");
 
 
 	return 0;
 	return 0;

+ 9 - 12
board/eNET/u-boot.lds

@@ -28,13 +28,12 @@ ENTRY(_start)
 SECTIONS
 SECTIONS
 {
 {
 	. = TEXT_BASE;		/* Location of bootcode in flash */
 	. = TEXT_BASE;		/* Location of bootcode in flash */
-	_i386boot_text_start = .;
+	__text_start = .;
 	.text  : { *(.text); }
 	.text  : { *(.text); }
 
 
 	. = ALIGN(4);
 	. = ALIGN(4);
 	.rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
 	.rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
 
 
-	_i386boot_text_size = SIZEOF(.text) + SIZEOF(.rodata);
 	. = ALIGN(4);
 	. = ALIGN(4);
 
 
 	.data : { *(.data) }
 	.data : { *(.data) }
@@ -65,28 +64,27 @@ SECTIONS
 	.u_boot_cmd : { *(.u_boot_cmd) }
 	.u_boot_cmd : { *(.u_boot_cmd) }
 	. = ALIGN(4);
 	. = ALIGN(4);
 	__u_boot_cmd_end = .;
 	__u_boot_cmd_end = .;
-	_i386boot_cmd_start = LOADADDR(.u_boot_cmd);
 
 
-	_i386boot_rel_dyn_start = .;
+	__rel_dyn_start = .;
 	.rel.dyn : { *(.rel.dyn) }
 	.rel.dyn : { *(.rel.dyn) }
-	_i386boot_rel_dyn_end = .;
+	__rel_dyn_end = .;
 
 
 	. = ALIGN(4);
 	. = ALIGN(4);
-	_i386boot_bss_start = ABSOLUTE(.);
+	__bss_start = ABSOLUTE(.);
 	.bss (NOLOAD) : { *(.bss) }
 	.bss (NOLOAD) : { *(.bss) }
-	_i386boot_bss_size = SIZEOF(.bss);
+	__bss_size = SIZEOF(.bss);
 
 
 	/* 16bit realmode trampoline code */
 	/* 16bit realmode trampoline code */
 	.realmode 0x7c0 : AT ( LOADADDR(.rel.dyn) + SIZEOF(.rel.dyn) ) { KEEP(*(.realmode)) }
 	.realmode 0x7c0 : AT ( LOADADDR(.rel.dyn) + SIZEOF(.rel.dyn) ) { KEEP(*(.realmode)) }
 
 
-	_i386boot_realmode = LOADADDR(.realmode);
-	_i386boot_realmode_size = SIZEOF(.realmode);
+	__realmode_start = LOADADDR(.realmode);
+	__realmode_size = SIZEOF(.realmode);
 
 
 	/* 16bit BIOS emulation code (just enough to boot Linux) */
 	/* 16bit BIOS emulation code (just enough to boot Linux) */
 	.bios 0 : AT ( LOADADDR(.realmode) + SIZEOF(.realmode) ) { KEEP(*(.bios)) }
 	.bios 0 : AT ( LOADADDR(.realmode) + SIZEOF(.realmode) ) { KEEP(*(.bios)) }
 
 
-	_i386boot_bios = LOADADDR(.bios);
-	_i386boot_bios_size = SIZEOF(.bios);
+	__bios_start = LOADADDR(.bios);
+	__bios_size = SIZEOF(.bios);
 
 
 	/* The load addresses below assumes that the flash
 	/* The load addresses below assumes that the flash
 	 * will be mapped so that 0x387f0000 == 0xffff0000
 	 * will be mapped so that 0x387f0000 == 0xffff0000
@@ -105,5 +103,4 @@ SECTIONS
 
 
 	. = 0xfff0;
 	. = 0xfff0;
 	.resetvec : AT (TEXT_BASE + 0x3fff0) { KEEP(*(.resetvec)); }
 	.resetvec : AT (TEXT_BASE + 0x3fff0) { KEEP(*(.resetvec)); }
-	_i386boot_end = (LOADADDR(.resetvec) + SIZEOF(.resetvec) );
 }
 }