]> xenbits.xensource.com Git - xen.git/commitdiff
xen: remove -N from the linker command line stable-4.18 staging-4.18
authorRoger Pau Monné <roger.pau@citrix.com>
Tue, 29 Apr 2025 10:11:06 +0000 (12:11 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 29 Apr 2025 10:11:06 +0000 (12:11 +0200)
It's unclear why -N is being used in the first place.  It was added by
commit 4676bbf96dc8 back in 2002 without any justification.

When building a PE image it's actually detrimental to forcefully set the
.text section as writable.  The GNU LD man page contains the following
warning regarding the -N option:

> Note: Although a writable text section is allowed for PE-COFF targets, it
> does not conform to the format specification published by Microsoft.

Remove the usage of -N uniformly on all architectures, assuming that the
addition was simply done as a copy and paste of the original x86 linking
rune.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Julien Grall <jgrall@amazon.com>
master commit: d444763f8ca556d0a67a4b933be303d346baef02
master date: 2025-04-23 16:12:25 +0200

xen/arch/arm/Makefile
xen/arch/ppc/Makefile
xen/arch/riscv/Makefile
xen/arch/x86/Makefile

index 7bf07e992046a47f685e35a23b7b4486b5df4e81..7c1d82c294d052dc6e49e94d434b7194afcd3cf8 100644 (file)
@@ -92,19 +92,19 @@ ifeq ($(CONFIG_ARM_64),y)
 endif
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
            $(objtree)/common/symbols-dummy.o -o $(dot-target).0
        $(NM) -pa --format=sysv $(dot-target).0 \
                | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
                > $(dot-target).0.S
        $(MAKE) $(build)=$(@D) $(dot-target).0.o
-       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
            $(dot-target).0.o -o $(dot-target).1
        $(NM) -pa --format=sysv $(dot-target).1 \
                | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
                > $(dot-target).1.S
        $(MAKE) $(build)=$(@D) $(dot-target).1.o
-       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
            $(dot-target).1.o -o $@
        $(NM) -pa --format=sysv $@ \
                | $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
index 71feb5e2c41f8494e83c1f12c53bf2a00837c41b..b9d61a785615ab0527a1aa6e8f22da2fc9afa8a1 100644 (file)
@@ -11,19 +11,19 @@ $(TARGET): $(TARGET)-syms
        cp -f $< $@
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
            $(objtree)/common/symbols-dummy.o -o $(dot-target).0
        $(NM) -pa --format=sysv $(dot-target).0 \
                | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
                > $(dot-target).0.S
        $(MAKE) $(build)=$(@D) $(dot-target).0.o
-       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
            $(dot-target).0.o -o $(dot-target).1
        $(NM) -pa --format=sysv $(dot-target).1 \
                | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
                > $(dot-target).1.S
        $(MAKE) $(build)=$(@D) $(dot-target).1.o
-       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
            $(dot-target).1.o -o $@
        $(NM) -pa --format=sysv $@ \
                | $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
index 2fefe14e7c2b4436f39dc88e3f90f52daa04cd96..c8f1896b2b50ec5d93938aa1035fc3e5d2d84fc7 100644 (file)
@@ -10,7 +10,7 @@ $(TARGET): $(TARGET)-syms
        $(OBJCOPY) -O binary -S $< $@
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) -o $@
+       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) -o $@
        $(NM) -pa --format=sysv $@ \
                | $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
                > $@.map
index 85b3f856085ea5ec10a90c63e93d5b817ea9223c..e8a4bf59c34f6e27bdcaa7f724a88b4c3eff1c87 100644 (file)
@@ -138,19 +138,19 @@ $(TARGET): $(TARGET)-syms $(efi-y) $(obj)/boot/mkelf32
 CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
            $(objtree)/common/symbols-dummy.o -o $(dot-target).0
        $(NM) -pa --format=sysv $(dot-target).0 \
                | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
                > $(dot-target).0.S
        $(MAKE) $(build)=$(@D) $(dot-target).0.o
-       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
            $(dot-target).0.o -o $(dot-target).1
        $(NM) -pa --format=sysv $(dot-target).1 \
                | $(objtree)/tools/symbols $(all_symbols) --sysv --sort $(syms-warn-dup-y) \
                > $(dot-target).1.S
        $(MAKE) $(build)=$(@D) $(dot-target).1.o
-       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+       $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
            $(orphan-handling-y) $(dot-target).1.o -o $@
        $(NM) -pa --format=sysv $@ \
                | $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
@@ -211,7 +211,7 @@ ifeq ($(CONFIG_DEBUG_INFO),y)
        $(if $(filter --strip-debug,$(EFI_LDFLAGS)),echo,:) "Will strip debug info from $(@F)"
 endif
        $(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-                 $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds -N $< $(relocs-dummy) \
+                 $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< $(relocs-dummy) \
                        $(objtree)/common/symbols-dummy.o $(note_file_option) \
                        -o $(dot-target).$(base).0 &&) :
        $(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).0) \
@@ -221,7 +221,7 @@ endif
                > $(dot-target).0s.S
        $(MAKE) $(build)=$(@D) .$(@F).0r.o .$(@F).0s.o
        $(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-                 $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds -N $< \
+                 $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< \
                        $(dot-target).0r.o $(dot-target).0s.o $(note_file_option) \
                        -o $(dot-target).$(base).1 &&) :
        $(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).1) \
@@ -230,7 +230,7 @@ endif
                | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
                > $(dot-target).1s.S
        $(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
-       $(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds -N $< \
+       $(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \
              $(dot-target).1r.o $(dot-target).1s.o $(orphan-handling-y) \
              $(note_file_option) -o $@
        $(NM) -pa --format=sysv $@ \