diff options
author | midipix <writeonce@midipix.org> | 2017-10-26 01:48:32 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2017-10-26 01:48:32 -0400 |
commit | 11b667c029b689cf82512519c57b13c9c43ce091 (patch) | |
tree | e7e49ee2158444f9a74805cc0b38fb8425cd74bc /src | |
parent | 7999c7b9c6f1806c4c99476651967dfba32673c4 (diff) | |
download | mdso-11b667c029b689cf82512519c57b13c9c43ce091.tar.bz2 mdso-11b667c029b689cf82512519c57b13c9c43ce091.tar.xz |
driver: mdso_map_input(): support empty symbol definition input files.
Diffstat (limited to 'src')
-rw-r--r-- | src/helper/mdso_map_input.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/helper/mdso_map_input.c b/src/helper/mdso_map_input.c index 77401f3..090de12 100644 --- a/src/helper/mdso_map_input.c +++ b/src/helper/mdso_map_input.c @@ -41,9 +41,11 @@ int mdso_map_input( if (ret < 0) return MDSO_SYSTEM_ERROR(dctx); - else if (st.st_size == 0) - return MDSO_CUSTOM_ERROR( - dctx,MDSO_ERR_SOURCE_SIZE_ZERO); + if (st.st_size == 0) { + map->size = 0; + map->addr = 0; + return 0; + } map->size = st.st_size; map->addr = mmap(0,map->size,prot,MAP_PRIVATE,fd,0); @@ -58,5 +60,5 @@ int mdso_map_input( int mdso_unmap_input(struct mdso_input * map) { - return munmap(map->addr,map->size); + return map->size ? munmap(map->addr,map->size) : 0; } |