ecomaikgolf / alma

toy kernel written in C++ for x86-64 machines with the mere purpose of learning OS development
8 stars 1 forks source link

kernel ELF is not executable type #18

Closed ecomaikgolf closed 3 years ago

ecomaikgolf commented 3 years ago

Having

Encabezado ELF:
  Mágico:  7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
  Clase:                             ELF64
  Datos:                             complemento a 2, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  Versión ABI:                       0
  Tipo:                              DYN (Fichero objeto compartido)

Should be

Encabezado ELF:
  Mágico:  7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
  Clase:                             ELF64
  Datos:                             complemento a 2, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  Versión ABI:                       0
  Tipo:                              EXEC (Fichero ejecutable)
ecomaikgolf commented 3 years ago

It was a bug that started happening when I worked with #17.

The reason was that I changed -static to -shared by solving #17 by trial and error.

Solution

Changing -shared to -static in the makefile

Encabezado ELF:
  Mágico:  7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
  Clase:                             ELF64
  Datos:                             complemento a 2, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  Versión ABI:                       0
  Tipo:                              EXEC (Fichero ejecutable)