Richard Hughes 7effe3f
commit 0f2ec3d6a60fc5dce2a0cc79ea24fa1cc03c0251
Richard Hughes 7effe3f
Author: Peter Jones <pjones@redhat.com>
Richard Hughes 7effe3f
Date:   Tue Feb 21 14:14:41 2023 -0500
cafdc47
Richard Hughes 7effe3f
    ld: Don't warn about RWX segment maps
Richard Hughes 7effe3f
    
Richard Hughes 7effe3f
    Newer gnu ld complains about RWX segment maps, and since we build with
Richard Hughes 7effe3f
    "--fatal-warnings" we get the following:
Richard Hughes 7effe3f
    
Richard Hughes 7effe3f
      ld -nostdlib --warn-common --no-undefined --fatal-warnings \
Richard Hughes 7effe3f
         --build-id=sha1 -shared -Bsymbolic \
Richard Hughes 7effe3f
         -L/builddir/build/BUILD/gnu-efi-3.0.9//apps/../aa64/lib \
Richard Hughes 7effe3f
         -L/builddir/build/BUILD/gnu-efi-3.0.9//apps/../aa64/gnuefi \
Richard Hughes 7effe3f
         /builddir/build/BUILD/gnu-efi-3.0.9//apps/../aa64/gnuefi/crt0-efi-aarch64.o \
Richard Hughes 7effe3f
         --defsym=EFI_SUBSYSTEM=0xa t.o -o t.so -lefi -lgnuefi \
Richard Hughes 7effe3f
         /usr/lib/gcc/aarch64-redhat-linux/13/libgcc.a \
Richard Hughes 7effe3f
         -T /builddir/build/BUILD/gnu-efi-3.0.9//apps/../gnuefi/elf_aarch64_efi.lds
Richard Hughes 7effe3f
      ld: warning: t.so has a LOAD segment with RWX permissions
Richard Hughes 7effe3f
    
Richard Hughes 7effe3f
    Since the final linked binary will be PE, rather than ELF, and won't
Richard Hughes 7effe3f
    even *have* segment maps, this should be safe to just disable.
Richard Hughes 7effe3f
    
Richard Hughes 7effe3f
    This patch adds "--no-warn-rwx-segments" to the ld command lines.
Richard Hughes 7effe3f
    
Richard Hughes 7effe3f
    Signed-off-by: Peter Jones <pjones@redhat.com>
cafdc47
cafdc47
diff --git a/Make.defaults b/Make.defaults
Richard Hughes 7effe3f
index a504f42..bb18c30 100755
cafdc47
--- a/Make.defaults
cafdc47
+++ b/Make.defaults
Richard Hughes 7effe3f
@@ -187,4 +187,4 @@ endif
Richard Hughes 7effe3f
 ARFLAGS := rDv
cafdc47
 ASFLAGS += $(ARCH3264)
cafdc47
 LDFLAGS	+= -nostdlib --warn-common --no-undefined --fatal-warnings \
cafdc47
-	   --build-id=sha1
cafdc47
+	   --build-id=sha1 --no-warn-rwx-segments