Skip to content

Instantly share code, notes, and snippets.

@aycanirican
Created February 21, 2012 20:15
Show Gist options
  • Select an option

  • Save aycanirican/1878613 to your computer and use it in GitHub Desktop.

Select an option

Save aycanirican/1878613 to your computer and use it in GitHub Desktop.
errno in dragonflybsd
% cat t.c
#include <errno.h>
f() { return errno; }
% gcc -c -Wall -Wextra -pedantic t.c
t.c:2: warning: return type defaults to 'int'
% objdump -h t.o
t.o: file format elf64-x86-64
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000027 0000000000000000 0000000000000000 00000040 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
1 .data 00000000 0000000000000000 0000000000000000 00000068 2**2
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000000 0000000000000000 0000000000000000 00000068 2**2
ALLOC
3 .comment 00000023 0000000000000000 0000000000000000 00000068 2**0
CONTENTS, READONLY
4 .eh_frame 00000050 0000000000000000 0000000000000000 00000090 2**3
CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
% objdump -r t.o
t.o: file format elf64-x86-64
RELOCATION RECORDS FOR [.text]:
OFFSET TYPE VALUE
0000000000000010 R_X86_64_GOTTPOFF errno+0xfffffffffffffffc
RELOCATION RECORDS FOR [.eh_frame]:
OFFSET TYPE VALUE
0000000000000020 R_X86_64_PC32 .text
000000000000003c R_X86_64_PC32 .text+0x000000000000001a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment