Skip to content

Commit

Permalink
lib: Install BPF objects as non-executable
Browse files Browse the repository at this point in the history
The BPF/XDP objects installed into BPF_OBJECT_DIR are not meant to be
executed directly, so don't install them as executable. This should also
prevent find-debuginfo from stripping away their symbol table.

Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
  • Loading branch information
shunghsiyu authored and tohojo committed Jun 13, 2023
1 parent e542acc commit b8ee97c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ install: all install_local
install -m 0755 -d $(DESTDIR)$(SBINDIR)
install -m 0755 -d $(DESTDIR)$(BPF_OBJECT_DIR)
$(if $(USER_TARGETS),install -m 0755 $(USER_TARGETS) $(DESTDIR)$(SBINDIR))
$(if $(XDP_OBJ_INSTALL),install -m 0755 $(XDP_OBJ_INSTALL) $(DESTDIR)$(BPF_OBJECT_DIR))
$(if $(XDP_OBJ_INSTALL),install -m 0644 $(XDP_OBJ_INSTALL) $(DESTDIR)$(BPF_OBJECT_DIR))
$(if $(MAN_FILES),install -m 0755 -d $(DESTDIR)$(MANDIR)/man8)
$(if $(MAN_FILES),install -m 0644 $(MAN_FILES) $(DESTDIR)$(MANDIR)/man8)
$(if $(SCRIPTS_FILES),install -m 0755 -d $(DESTDIR)$(SCRIPTSDIR))
Expand Down
2 changes: 1 addition & 1 deletion lib/libxdp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ install: all
$(Q)install -m 0644 $(LIB_HEADERS) $(DESTDIR)$(HDRDIR)/
$(Q)install -m 0644 $(PC_FILE) $(DESTDIR)$(LIBDIR)/pkgconfig/
$(Q)cp -fpR $(SHARED_LIBS) $(STATIC_LIBS) $(DESTDIR)$(LIBDIR)
$(Q)install -m 0755 $(XDP_OBJS) $(DESTDIR)$(BPF_OBJECT_DIR)
$(Q)install -m 0644 $(XDP_OBJS) $(DESTDIR)$(BPF_OBJECT_DIR)
$(if $(MAN_FILES),$(Q)install -m 0755 -d $(DESTDIR)$(MANDIR)/man3)
$(if $(MAN_FILES),$(Q)install -m 0644 $(MAN_FILES) $(DESTDIR)$(MANDIR)/man3)

Expand Down

0 comments on commit b8ee97c

Please sign in to comment.