Browse Source

[librm] Avoid (harmless) collisions with linker symbols

The symbol_text16 is defined globally by the linker.  Use rm_text16
instead of _text16 for the local variable within librm.S to avoid
confusion when reading linker maps.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 years ago
parent
commit
4d8a009ccf
1 changed files with 14 additions and 14 deletions
  1. 14
    14
      src/arch/i386/transitions/librm.S

+ 14
- 14
src/arch/i386/transitions/librm.S View File

97
 	pushl	%eax
97
 	pushl	%eax
98
 	pushl	%ebx
98
 	pushl	%ebx
99
 
99
 
100
-	/* Store _virt_offset and set up virtual_cs and virtual_ds segments */
100
+	/* Store virt_offset and set up virtual_cs and virtual_ds segments */
101
 	movl	%edi, %eax
101
 	movl	%edi, %eax
102
 	movw	$virtual_cs, %bx
102
 	movw	$virtual_cs, %bx
103
 	call	set_seg_base
103
 	call	set_seg_base
104
 	movw	$virtual_ds, %bx
104
 	movw	$virtual_ds, %bx
105
 	call	set_seg_base	
105
 	call	set_seg_base	
106
-	movl	%edi, _virt_offset
106
+	movl	%edi, rm_virt_offset
107
 
107
 
108
 	/* Negate virt_offset */
108
 	/* Negate virt_offset */
109
 	negl	%edi
109
 	negl	%edi
110
 		
110
 		
111
-	/* Store rm_cs and _text16, set up real_cs segment */
111
+	/* Store rm_cs and text16, set up real_cs segment */
112
 	xorl	%eax, %eax
112
 	xorl	%eax, %eax
113
 	movw	%cs, %ax
113
 	movw	%cs, %ax
114
 	movw	%ax, rm_cs
114
 	movw	%ax, rm_cs
116
 	movw	$real_cs, %bx
116
 	movw	$real_cs, %bx
117
 	call	set_seg_base
117
 	call	set_seg_base
118
 	addr32 leal	(%eax, %edi), %ebx
118
 	addr32 leal	(%eax, %edi), %ebx
119
-	movl	%ebx, _text16
119
+	movl	%ebx, rm_text16
120
 
120
 
121
-	/* Store rm_ds and _data16, set up real_ds segment */
121
+	/* Store rm_ds and data16, set up real_ds segment */
122
 	xorl	%eax, %eax
122
 	xorl	%eax, %eax
123
 	movw	%ds, %ax
123
 	movw	%ds, %ax
124
 	movw	%ax, %cs:rm_ds
124
 	movw	%ax, %cs:rm_ds
126
 	movw	$real_ds, %bx
126
 	movw	$real_ds, %bx
127
 	call	set_seg_base
127
 	call	set_seg_base
128
 	addr32 leal	(%eax, %edi), %ebx
128
 	addr32 leal	(%eax, %edi), %ebx
129
-	movl	%ebx, _data16
129
+	movl	%ebx, rm_data16
130
 
130
 
131
 	/* Set GDT and IDT base */
131
 	/* Set GDT and IDT base */
132
 	movl	%eax, gdt_base
132
 	movl	%eax, gdt_base
182
 	movw	%cs:rm_ds, %ax
182
 	movw	%cs:rm_ds, %ax
183
 	movw	%ax, %ds
183
 	movw	%ax, %ds
184
 
184
 
185
-	/* Add _virt_offset, _text16 and _data16 to stack to be
185
+	/* Add virt_offset, text16 and data16 to stack to be
186
 	 * copied, and also copy the return address.
186
 	 * copied, and also copy the return address.
187
 	 */
187
 	 */
188
-	pushl	_virt_offset
189
-	pushl	_text16
190
-	pushl	_data16
188
+	pushl	rm_virt_offset
189
+	pushl	rm_text16
190
+	pushl	rm_data16
191
 	addw	$16, %cx /* %ecx must be less than 64kB anyway */
191
 	addw	$16, %cx /* %ecx must be less than 64kB anyway */
192
 
192
 
193
 	/* Real-mode %ss:%sp => %ebp:%edx and virtual address => %esi */
193
 	/* Real-mode %ss:%sp => %ebp:%edx and virtual address => %esi */
197
 	movl	%ebp, %eax
197
 	movl	%ebp, %eax
198
 	shll	$4, %eax
198
 	shll	$4, %eax
199
 	addr32 leal (%eax,%edx), %esi
199
 	addr32 leal (%eax,%edx), %esi
200
-	subl	_virt_offset, %esi
200
+	subl	rm_virt_offset, %esi
201
 
201
 
202
 	/* Switch to protected mode */
202
 	/* Switch to protected mode */
203
 	cli
203
 	cli
557
  */
557
  */
558
 	/* Internal copies, created by init_librm (which runs in real mode) */
558
 	/* Internal copies, created by init_librm (which runs in real mode) */
559
 	.section ".data16", "aw", @progbits
559
 	.section ".data16", "aw", @progbits
560
-_virt_offset:	.long 0
561
-_text16:	.long 0
562
-_data16:	.long 0
560
+rm_virt_offset:	.long 0
561
+rm_text16:	.long 0
562
+rm_data16:	.long 0
563
 
563
 
564
 	/* Externally-visible copies, created by real_to_prot */
564
 	/* Externally-visible copies, created by real_to_prot */
565
 	.section ".data", "aw", @progbits
565
 	.section ".data", "aw", @progbits

Loading…
Cancel
Save