boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

bss-start-symbol.after (677B)


      1     /* `__bss_start` mirror of the auto-defined `_end` (= end of .bss).
      2      * Together they let a kernel-style image zero its .bss without an
      3      * ld-script section bracket.  Stock tcc 0.9.26 only synthesizes
      4      * `_end`, so freestanding asm that wants a start-of-bss anchor
      5      * either needs an ld script or this patch. */
      6     set_elf_sym(symtab_section,
      7                 0, 0,
      8                 ELFW(ST_INFO)(STB_GLOBAL, STT_NOTYPE), 0,
      9                 bss_section->sh_num, "__bss_start");
     10     set_elf_sym(symtab_section,
     11                 bss_section->data_offset, 0,
     12                 ELFW(ST_INFO)(STB_GLOBAL, STT_NOTYPE), 0,
     13                 bss_section->sh_num, "_end");