Source: cirosantilli/elf-hello-world/stt-file

= `STT_FILE`

Entry 1 has `ELF64_R_TYPE == STT_FILE`. `ELF64_R_TYPE` is continued inside of `st_info`.

Byte analysis:

* 10 8: `st_name` = `01000000` = character 1 in the `.strtab`, which until the following `\0` makes `hello_world.asm`

  This piece of information file may be used by the linker to decide on which segment sections go: e.g. in `ld` linker script we write:

  ``
  segment_name :
  {
      file(section)
  }
  ``

  to pick a section from a given file.

  Most of the time however, we will just dump all sections with a given name together with:

  ``
  segment_name :
  {
      *(section)
  }
  ``
* 10 12: `st_info` = `04`

  Bits 0-3 = `ELF64_R_TYPE` = Type = `4` = `STT_FILE`: the main purpose of this entry is to use `st_name` to indicate the name of the file which generated this object file.

  Bits 4-7 = `ELF64_ST_BIND` = Binding = `0` = `STB_LOCAL`. Required value for `STT_FILE`.
* 10 13: `st_shndx` = Symbol Table Section header Index = `f1ff` = `SHN_ABS`. Required for `STT_FILE`.
* 20 0: `st_value` = 8x `00`: required for value for `STT_FILE`
* 20 8: `st_size` = 8x `00`: no allocated size

Now from the `readelf`, we interpret the others quickly.