1

_thread int errno;

int get_errno() { return errno; }

And when i am disassembling it i am getting for x86

  .globl     errno
  .section  .tbss,"awT",@nobits
  .align    4
  .type     errno, @object
  .size     errno, 4
  errno:
  .zero     4
   movl     %fs:errno@tpoff, %eax

What does <.type errno , @object indicate here>

Please send a link of any valid document if you have

1 Answers1

1

.type errno, @object sets the symbol type. It is represented in ELF as part of the st_info field in the Elf32_Sym or Elf64_Sym struct. <elf.h> uses STT_* constants for these symbols, and @object corresponds to STT_OBJECT. The constant values can be extracted from the st_info field using the ELF32_ST_TYPE and ELF64_ST_TYPE macros.

In the ELF specification, this is described in the Symbol Table chapter.

Florian Weimer
  • 32,022
  • 3
  • 48
  • 92