[pushed] gcov: call mmap MAP_ANONYMOUS with fd equal to -1

Message ID ea233b46-abd6-556f-6678-3996af72e2ed@suse.cz
State New
Headers show
Series
  • [pushed] gcov: call mmap MAP_ANONYMOUS with fd equal to -1
Related show

Commit Message

Martin Liška March 4, 2021, 10:53 a.m.
Pushed as obvious.

Martin

libgcc/ChangeLog:

	PR gcov-profile/99385
	* libgcov.h (allocate_gcov_kvp): Call mmap with fd equal to -1.
---
  libgcc/libgcov.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.30.1

Patch

diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h
index 9c5fcfba4ad..acdb7cd1500 100644
--- a/libgcc/libgcov.h
+++ b/libgcc/libgcov.h
@@ -426,7 +426,7 @@  allocate_gcov_kvp (void)
      {
        void *ptr = mmap (NULL, MMAP_CHUNK_SIZE,
  			PROT_READ | PROT_WRITE,
-			MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
+			MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
        if (ptr != MAP_FAILED)
  	{
  	  __gcov_kvp_dynamic_pool = ptr;