* "non absolute segment" error. This is most probably a bug in gas.
****************************************************************************
*/
- .section ".data16", "aw", @progbits
+ .section ".data16.gdt", "aw", @progbits
.align 16
gdt:
gdtr: /* The first GDT entry is unused, the GDTR can fit here. */
* %edi : Physical base of protected-mode code (virt_offset)
****************************************************************************
*/
- .section ".text16", "ax", @progbits
+ .section ".text16.init_librm", "ax", @progbits
.code16
.globl init_librm
init_librm:
popl %eax
lret
- .section ".text16", "ax", @progbits
+ .section ".text16.set_seg_base", "ax", @progbits
.code16
set_seg_base:
1: movw %ax, 2(%bx)
*
****************************************************************************
*/
- .section ".text16", "ax", @progbits
+ .section ".text16.real_to_prot", "ax", @progbits
.code16
real_to_prot:
/* Enable A20 line */
orb $CR0_PE, %al
movl %eax, %cr0
data32 ljmp $VIRTUAL_CS, $r2p_pmode
- .section ".text", "ax", @progbits
+ .section ".text.real_to_prot", "ax", @progbits
.code32
r2p_pmode:
/* Set up protected-mode data segments and stack pointer */
*
****************************************************************************
*/
- .section ".text", "ax", @progbits
+ .section ".text.prot_to_real", "ax", @progbits
.code32
prot_to_real:
/* Copy real-mode global descriptor table register to RM code segment */
movw %ax, %gs
movw %ax, %ss
ljmp $REAL_CS, $p2r_rmode
- .section ".text16", "ax", @progbits
+ .section ".text16.prot_to_real", "ax", @progbits
.code16
p2r_rmode:
/* Load real-mode GDT */
.globl rm_cs
.equ rm_cs, ( p2r_ljmp_rm_cs + 3 )
- .section ".text16.data", "aw", @progbits
+ .section ".text16.data.rm_ds", "aw", @progbits
.globl rm_ds
rm_ds: .word 0
/* Real-mode global and interrupt descriptor table registers */
- .section ".text16.data", "aw", @progbits
+ .section ".text16.data.rm_gdtr", "aw", @progbits
rm_gdtr:
.word 0 /* Limit */
.long 0 /* Base */
#define PC_OFFSET_FUNCTION ( PC_OFFSET_RETADDR + 4 )
#define PC_OFFSET_END ( PC_OFFSET_FUNCTION + 4 )
- .section ".text16", "ax", @progbits
+ .section ".text16.prot_call", "ax", @progbits
.code16
.globl prot_call
prot_call:
movl $PC_OFFSET_END, %ecx
pushl $pc_pmode
jmp real_to_prot
- .section ".text", "ax", @progbits
+ .section ".text.prot_call", "ax", @progbits
.code32
pc_pmode:
/* Call function */
movl %esp, %esi
pushl $pc_rmode
jmp prot_to_real
- .section ".text16", "ax", @progbits
+ .section ".text16.prot_call", "ax", @progbits
.code16
pc_rmode:
/* Restore registers and flags and return */
#define RC_OFFSET_FUNCTION ( RC_OFFSET_RETADDR + 4 )
#define RC_OFFSET_END ( RC_OFFSET_FUNCTION + 4 )
- .section ".text", "ax", @progbits
+ .section ".text.real_call", "ax", @progbits
.code32
.globl real_call
real_call:
pushl $rc_rmode
movl $rm_default_gdtr_idtr, %esi
jmp prot_to_real
- .section ".text16", "ax", @progbits
+ .section ".text16.real_call", "ax", @progbits
.code16
rc_rmode:
/* Call real-mode function */
movl $RC_OFFSET_RETADDR, %ecx
pushl $rc_pmode
jmp real_to_prot
- .section ".text", "ax", @progbits
+ .section ".text.real_call", "ax", @progbits
.code32
rc_pmode:
/* Restore registers and return */
/* Function vector, used because "call xx(%sp)" is not a valid
* 16-bit expression.
*/
- .section ".data16", "aw", @progbits
+ .section ".bss16.rc_function", "aw", @nobits
rc_function: .word 0, 0
/* Default real-mode global and interrupt descriptor table registers */
- .section ".data", "aw", @progbits
+ .section ".data.rm_default_gdtr_idtr", "aw", @progbits
rm_default_gdtr_idtr:
.word 0 /* Global descriptor table limit */
.long 0 /* Global descriptor table base */
*
****************************************************************************
*/
- .section ".text16", "ax", @progbits
+ .section ".text16.flatten_real_mode", "ax", @progbits
.code16
.globl flatten_real_mode
flatten_real_mode:
/* Return */
ret
- .section ".text", "ax", @progbits
+ .section ".text.flatten_dummy", "ax", @progbits
.code32
flatten_dummy:
ret
* to us.
****************************************************************************
*/
- .section ".data", "aw", @progbits
+ .section ".bss.rm_sp", "aw", @nobits
.globl rm_sp
rm_sp: .word 0
+
+ .section ".bss.rm_ss", "aw", @nobits
.globl rm_ss
rm_ss: .word 0
+
+ .section ".data.pm_esp", "aw", @progbits
pm_esp: .long _estack
/****************************************************************************
****************************************************************************
*/
/* Internal copies, created by init_librm (which runs in real mode) */
- .section ".data16", "aw", @progbits
+ .section ".bss16.rm_virt_offset", "aw", @nobits
rm_virt_offset: .long 0
rm_text16: .long 0
rm_data16: .long 0
/* Externally-visible copies, created by real_to_prot */
- .section ".data", "aw", @progbits
+ .section ".bss.virt_offset", "aw", @nobits
.globl virt_offset
virt_offset: .long 0
.globl text16