size_t strtabidx;
        struct elf_sec_desc *secs;
        int sec_cnt;
-       int maps_shndx;
        int btf_maps_shndx;
        __u32 btf_maps_sec_btf_id;
        int text_shndx;
         */
        obj->efile.obj_buf = obj_buf;
        obj->efile.obj_buf_sz = obj_buf_sz;
-       obj->efile.maps_shndx = -1;
        obj->efile.btf_maps_shndx = -1;
        obj->efile.st_ops_shndx = -1;
        obj->kconfig_map_idx = -1;
                        if (err)
                                return err;
                } else if (strcmp(name, "maps") == 0) {
-                       obj->efile.maps_shndx = idx;
+                       pr_warn("elf: legacy map definitions in 'maps' section are not supported by libbpf v1.0+\n");
+                       return -ENOTSUP;
                } else if (strcmp(name, MAPS_ELF_SEC) == 0) {
                        obj->efile.btf_maps_shndx = idx;
                } else if (strcmp(name, BTF_ELF_SEC) == 0) {
 static bool bpf_object__shndx_is_maps(const struct bpf_object *obj,
                                      int shndx)
 {
-       return shndx == obj->efile.maps_shndx ||
-              shndx == obj->efile.btf_maps_shndx;
+       return shndx == obj->efile.btf_maps_shndx;
 }
 
 static enum libbpf_map_type