On 25/11/2018 14:18, Florian Klämpfl wrote:
Am 25.11.2018 um 14:30 schrieb Colin Western:
What generates the header? Is it fpc, an external linker or the loader?

Can you please run the following C program:

#include <sys/auxv.h>
#include <stdio.h>

int main()
{
   printf("AT_PHDR: %lx\n",getauxval(AT_PHDR));
   printf("AT_PHNUM: %lx\n",getauxval(AT_PHNUM));
}

and include also the relevant part of an objdump?
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

gcc -m32 -g florian.c

./a.out
AT_PHDR: 8048034
AT_PHNUM: b

objdump -x a.out | more

a.out:     file format elf32-i386
a.out
architecture: i386, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x08049070

Program Header:
    PHDR off    0x00000034 vaddr 0x08048034 paddr 0x08048034 align 2**2
         filesz 0x00000160 memsz 0x00000160 flags r--
  INTERP off    0x00000194 vaddr 0x08048194 paddr 0x08048194 align 2**0
         filesz 0x00000013 memsz 0x00000013 flags r--
    LOAD off    0x00000000 vaddr 0x08048000 paddr 0x08048000 align 2**12
         filesz 0x0000032c memsz 0x0000032c flags r--
    LOAD off    0x00001000 vaddr 0x08049000 paddr 0x08049000 align 2**12
         filesz 0x00000260 memsz 0x00000260 flags r-x
    LOAD off    0x00002000 vaddr 0x0804a000 paddr 0x0804a000 align 2**12
         filesz 0x0000015c memsz 0x0000015c flags r--
    LOAD off    0x00002f0c vaddr 0x0804bf0c paddr 0x0804bf0c align 2**12
         filesz 0x00000110 memsz 0x00000114 flags rw-
 DYNAMIC off    0x00002f14 vaddr 0x0804bf14 paddr 0x0804bf14 align 2**2
         filesz 0x000000e8 memsz 0x000000e8 flags rw-
    NOTE off    0x000001a8 vaddr 0x080481a8 paddr 0x080481a8 align 2**2
         filesz 0x00000044 memsz 0x00000044 flags r--
EH_FRAME off    0x0000202c vaddr 0x0804a02c paddr 0x0804a02c align 2**2
         filesz 0x0000003c memsz 0x0000003c flags r--
   STACK off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**4
         filesz 0x00000000 memsz 0x00000000 flags rw-
   RELRO off    0x00002f0c vaddr 0x0804bf0c paddr 0x0804bf0c align 2**0
         filesz 0x000000f4 memsz 0x000000f4 flags r--

Dynamic Section:
  NEEDED               libc.so.6
  INIT                 0x08049000
  FINI                 0x08049248
  INIT_ARRAY           0x0804bf0c
  INIT_ARRAYSZ         0x00000004
  FINI_ARRAY           0x0804bf10
  FINI_ARRAYSZ         0x00000004
  GNU_HASH             0x080481ec
  STRTAB               0x0804826c
  SYMTAB               0x0804820c
  STRSZ                0x00000061
  SYMENT               0x00000010
  DEBUG                0x00000000
  PLTGOT               0x0804c000
  PLTRELSZ             0x00000018
  PLTREL               0x00000011
  JMPREL               0x08048314
  REL                  0x0804830c
  RELSZ                0x00000008
  RELENT               0x00000008
  VERNEED              0x080482dc
  VERNEEDNUM           0x00000001
  VERSYM               0x080482ce

Version References:
  required from libc.so.6:
    0x06969196 0x00 03 GLIBC_2.16
    0x0d696910 0x00 02 GLIBC_2.0

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .interp       00000013  08048194  08048194  00000194  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  1 .note.ABI-tag 00000020  080481a8  080481a8  000001a8  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .note.gnu.build-id 00000024  080481c8  080481c8  000001c8 2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .gnu.hash     00000020  080481ec  080481ec  000001ec  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .dynsym       00000060  0804820c  0804820c  0000020c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .dynstr       00000061  0804826c  0804826c  0000026c  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 .gnu.version  0000000c  080482ce  080482ce  000002ce  2**1
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 .gnu.version_r 00000030  080482dc  080482dc  000002dc  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  8 .rel.dyn      00000008  0804830c  0804830c  0000030c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  9 .rel.plt      00000018  08048314  08048314  00000314  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 10 .init         00000024  08049000  08049000  00001000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 11 .plt          00000040  08049030  08049030  00001030  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 12 .text         000001d5  08049070  08049070  00001070  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 13 .fini         00000018  08049248  08049248  00001248  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 14 .rodata       00000029  0804a000  0804a000  00002000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 15 .eh_frame_hdr 0000003c  0804a02c  0804a02c  0000202c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 16 .eh_frame     000000f4  0804a068  0804a068  00002068  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 17 .init_array   00000004  0804bf0c  0804bf0c  00002f0c  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 18 .fini_array   00000004  0804bf10  0804bf10  00002f10  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 19 .dynamic      000000e8  0804bf14  0804bf14  00002f14  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 20 .got          00000004  0804bffc  0804bffc  00002ffc  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 21 .got.plt      00000018  0804c000  0804c000  00003000  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 22 .data         00000004  0804c018  0804c018  00003018  2**0
                  CONTENTS, ALLOC, LOAD, DATA
 23 .bss          00000004  0804c01c  0804c01c  0000301c  2**0
                  ALLOC
 24 .comment      0000002c  00000000  00000000  0000301c  2**0
                  CONTENTS, READONLY
 25 .gnu.build.attributes 000004e4  0804c020  0804c020  00003048 2**2
                  CONTENTS, READONLY
 26 .debug_aranges 00000020  00000000  00000000  0000352c  2**0
                  CONTENTS, READONLY, DEBUGGING
 27 .debug_info   0000030b  00000000  00000000  0000354c  2**0
                  CONTENTS, READONLY, DEBUGGING
 28 .debug_abbrev 000000cc  00000000  00000000  00003857  2**0
                  CONTENTS, READONLY, DEBUGGING
 29 .debug_line   000000f4  00000000  00000000  00003923  2**0
                  CONTENTS, READONLY, DEBUGGING
 30 .debug_str    00000265  00000000  00000000  00003a17  2**0
                  CONTENTS, READONLY, DEBUGGING
SYMBOL TABLE:
08048194 l    d  .interp    00000000              .interp
080481a8 l    d  .note.ABI-tag    00000000 .note.ABI-tag
080481c8 l    d  .note.gnu.build-id    00000000 .note.gnu.build-id
080481ec l    d  .gnu.hash    00000000              .gnu.hash
0804820c l    d  .dynsym    00000000              .dynsym
0804826c l    d  .dynstr    00000000              .dynstr
080482ce l    d  .gnu.version    00000000 .gnu.version
080482dc l    d  .gnu.version_r    00000000 .gnu.version_r
0804830c l    d  .rel.dyn    00000000              .rel.dyn
08048314 l    d  .rel.plt    00000000              .rel.plt
08049000 l    d  .init    00000000              .init
08049030 l    d  .plt    00000000              .plt
08049070 l    d  .text    00000000              .text
08049248 l    d  .fini    00000000              .fini


_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to