This is the mail archive of the libc-alpha@sourceware.org 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]
Other format: [Raw text]

Re: Propose to Use madvise API on Runtime Loader


Hi Rich,
On Fri, May 23, 2014 at 12:01:46AM -0400, Rich Felker wrote:
> Your code as written drops from the beginning of the map up to a
> length based on the position and number of reloctions, which is utter
> nonsense. But even if that were fixed, it would be incorrect because
> madvise has page granularity.
    My code is to point out the range of a mapped elf file that may be
    dropped. The page granularity problem is easy to fix, in my real
    solution there is a round-down operation before passing the
    parameter like this : end = end & ~PAGE_MASK.

    A cplusplus program usually contain many virtual tables. Their
    contents require relocation.So the .rel.dyn is a huge section.They
    are just needed when relocation. After that their useless. So
    dropping these content makes sense.

--
Lin Zuojian


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