segment alignment in AMD64

From: Sean P. Dew <freebsd.work_at_gmail.com>
Date: Sun, 28 Jun 2009 16:42:38 -0700
Hi,

Why is a loadable segment aligned to 1 MB on AMD64 while the pagezie is
still 4K for a user application. Is there anyway to change it back to 4K, It
is not making sense to me is because if my file segment is around 400K, we
are wasting 1 MB of virtual address space ( granted it is not a lot for
X64).  I am trying to find out the reason. I am posting the readelf output
of a .so. Any help is appreciated.

Thanks
Program Headers:
  Type           Offset   VirtAddr           PhysAddr           FileSiz
MemSiz   Flg Align
  LOAD           0x000000 0x0000000000000000 0x0000000000000000 0x001428
0x001428 R E 0x100000
  LOAD           0x001428 0x0000000000101428 0x0000000000101428 0x000438
0x007bd8 RW  0x100000
  DYNAMIC        0x001618 0x0000000000101618 0x0000000000101618 0x000180
0x000180 RW  0x8
  GNU_EH_FRAME   0x001420 0x0000000000001420 0x0000000000001420 0x000008
0x000008 R   0x4
 Section to Segment mapping:
  Segment Sections...
   00     .hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.dyn
.rela.plt .init .plt .text .fini .rodata .eh_frame_hdr
   01     .data .eh_frame .dynamic .ctors .dtors .jcr .got .bss
   02     .dynamic
   03     .eh_frame_hdr
Received on Sun Jun 28 2009 - 21:42:40 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:50 UTC