Use mmap and cache the view buffer for get_view
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 6 Feb 2015 17:05:35 +0000 (09:05 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 6 Feb 2015 17:05:57 +0000 (09:05 -0800)
commit2aec968d4df313f893f239a1a69aef2392a16b85
treec6545b73df74130e9c2ff0a078c7af099ee1c6c7
parentd6c146e9ea09e050e6f05fa00312de3fe763e811
Use mmap and cache the view buffer for get_view

This patch uses mmap if it is available and works.  It also caches the
view buffer for get_view.

* configure.ac: Add AC_FUNC_MMAP.
* config.in: Regenerated.
* configure: Likewise.
* plugin.c: Include <sys/mman.h>.
(MAP_FAILED): New.  Defined if not defined.
(PROT_READ): Likewise.
(MAP_PRIVATE): Likewise.
(view_buffer_t): New.
(plugin_input_file_t): Add view_buffer.
(get_view): Try mmap and cache the view buffer.
(plugin_maybe_claim): Initialize view_buffer.
ld/ChangeLog
ld/config.in
ld/configure
ld/configure.ac
ld/plugin.c