Skip to content

Commit

Permalink
Fix LD script and bootstrap code
Browse files Browse the repository at this point in the history
  • Loading branch information
djphoenix committed Apr 20, 2017
1 parent 255c20d commit ba8aa8d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
23 changes: 7 additions & 16 deletions ld/system.ld
Expand Up @@ -28,30 +28,21 @@ SECTIONS
.reloc 0x400FE0 : ALIGN(1) {}
.text 0x401000 : ALIGN(1) {
__text_start__ = . ;
*(.text32)
*(.init)

. = ALIGN(64);

*boot.a:bootstrap.o(.text .text.*)
*(.text .text.*)
*(.gnu.linkonce.t.*)
PROVIDE (etext = .);
*(.fini)
. = ALIGN(64);
__text_end__ = . ;
}
.data BLOCK(1) : ALIGN(1) {
.data : ALIGN(1) {
__data_start__ = . ;
*(.rodata .rodata.*)
. = ALIGN(8);

. = ALIGN(8);
__VTABLE_START__ = . ;
___INIT_LIST__ = .; __INIT_LIST__ = . ;
LONG (0); LONG (0); *(.init_array*) LONG (0); LONG (0);
___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
LONG (0); LONG (0); *(.ctors); *(.ctor); *(SORT(.ctors.*)); LONG (0); LONG (0);
___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
LONG (0); LONG (0); *(.dtors); *(.dtor); *(SORT(.dtors.*)); LONG (0); LONG (0);
__INIT_LIST__ = . ; QUAD(0) *(.init_array*) QUAD(0)
__CTOR_LIST__ = . ; QUAD(0) *(.ctor*) QUAD(0)
__DTOR_LIST__ = . ; QUAD(0) *(.dtor*) QUAD(0)
*(.data.rel.*)
__VTABLE_END__ = . ;
*(.got .got.*)
Expand All @@ -63,7 +54,7 @@ SECTIONS
. = ALIGN(64);
__modules_end__ = . ;
}
.bss BLOCK(1) : ALIGN(1) {
.bss : ALIGN(1) {
__bss_start__ = . ;
*(.bss .bss.*)
*(COMMON)
Expand Down
4 changes: 2 additions & 2 deletions src/boot/bootstrap.s
Expand Up @@ -15,7 +15,7 @@
# along with this program. If not, see <http:#www.gnu.org/licenses/>.

.code32
.section .text32
.section .text
.global _start
.global __main
.global _efi_start
Expand Down Expand Up @@ -227,7 +227,7 @@ x64_entry:
jmp _ZN14ProcessManager12process_loopEv

reloc_vtables:
lea -_start(%rip), %rcx
lea reloc_vtables-reloc_vtables(%rip), %rcx
lea __VTABLE_START__(%rip), %rbp
lea __VTABLE_END__(%rip), %rdx
1:
Expand Down

0 comments on commit ba8aa8d

Please sign in to comment.