Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[linux.git] / tools / lib / bpf / libbpf.c
index 8eb2cd4ef2889a0dd6f770808d55116b3f56428f..d7d8f78f88463801f48a3019808c6f72f0962219 100644 (file)
@@ -498,7 +498,7 @@ struct bpf_struct_ops {
 #define KSYMS_SEC ".ksyms"
 #define STRUCT_OPS_SEC ".struct_ops"
 #define STRUCT_OPS_LINK_SEC ".struct_ops.link"
-#define ARENA_SEC ".arena.1"
+#define ARENA_SEC ".addr_space.1"
 
 enum libbpf_map_type {
        LIBBPF_MAP_UNSPEC,
@@ -1664,6 +1664,10 @@ static int sys_memfd_create(const char *name, unsigned flags)
        return syscall(__NR_memfd_create, name, flags);
 }
 
+#ifndef MFD_CLOEXEC
+#define MFD_CLOEXEC 0x0001U
+#endif
+
 static int create_placeholder_fd(void)
 {
        int fd;
@@ -5366,8 +5370,8 @@ retry:
                                        goto err_out;
                        }
                        if (map->def.type == BPF_MAP_TYPE_ARENA) {
-                               map->mmaped = mmap((void *)map->map_extra, bpf_map_mmap_sz(map),
-                                                  PROT_READ | PROT_WRITE,
+                               map->mmaped = mmap((void *)(long)map->map_extra,
+                                                  bpf_map_mmap_sz(map), PROT_READ | PROT_WRITE,
                                                   map->map_extra ? MAP_SHARED | MAP_FIXED : MAP_SHARED,
                                                   map->fd, 0);
                                if (map->mmaped == MAP_FAILED) {
This page took 0.043521 seconds and 4 git commands to generate.