This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: dl-load.c suggestion


On Fri, May 22, 1998 at 07:48:09PM -0400, Roland McGrath wrote:
> No, just all the segments as a contiguous region.  
> Please note how the function already works; I think you have forgotten.

That is not going to work in general.  For instance, from my /bin/ls:

    LOAD off    0x0000000000000000 vaddr 0x0000000120000000
         paddr  0x0000000120000000 align 2**20
         filesz 0x0000000000009680 memsz 0x0000000000009680 flags r-x
    LOAD off    0x0000000000009680 vaddr 0x0000000120109680
         paddr  0x0000000120109680 align 2**20
         filesz 0x0000000000000cf0 memsz 0x0000000000000fa4 flags rwx

Notice that the load segments are not a contiguous region. 

This will happen on any target that defines a "logical page size"
larger than the actual physical page size.  Usually this logical
page size is set to the largest page size available to the architecture
(for Alpha and Sparc v9, this is 1MB). 

It may also happen if the target opts for a red-zone between the
two segments.  I know this was common practice under COFF; I don't
know off the top of my head if any ELF variants do.

It might, perhaps, pay off on Intel.  But since the entire tlb must be
flushed for any change to any page mapping -- including cpu cross-calls
in the SMP Case -- the win may be relatively small.  Benchmarking would
be in order.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]