eighty-six icon indicating copy to clipboard operation
eighty-six copied to clipboard

`.boot` section is flagged as writeable

Open japaric opened this issue 9 years ago • 3 comments

The .boot section contains the multiboot header.

$ readelf -hS target/x86_64/release/kernel
  [ 1] .boot             PROGBITS         0000000000100000  000000b0
       0000000000000018  0000000000000000  WA       0     0     1

Unsure how bad this really is, but it seems to be affecting the output of the size command:

$ size target/x86_64/release/kernel
   text    data     bss     dec     hex filename
    132      24       0     156      9c target/x86_64/release/kernel

size is classifying the .boot section as "data" when it should be classified as "text".

japaric avatar Jul 30 '16 21:07 japaric

Possible solution: Place the multiboot header section under .text. This fixes the output of size but the multiheader section would then be flagged as executable, which is not true.

japaric avatar Jul 30 '16 21:07 japaric

This just might be me being a noob.

steveklabnik avatar Aug 29 '16 18:08 steveklabnik

@steveklabnik Nah, this is a problem with my implementation, which creates the multiboot header in the linker script. The intermezzos implementation doesn't have this problem:

$ size build/kernel.bin
   text    data     bss     dec     hex filename
    142       0       0     142      8e build/kernel.bin

japaric avatar Aug 29 '16 23:08 japaric