public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH] powerpc: add -n to LDFLAGS
@ 2017-03-10 10:30 Cédric Le Goater
  2017-03-10 10:45 ` Thomas Huth
  2017-03-15 17:11 ` Radim Krčmář
  0 siblings, 2 replies; 3+ messages in thread
From: Cédric Le Goater @ 2017-03-10 10:30 UTC (permalink / raw)
  To: kvm
  Cc: Thomas Huth, Laurent Vivier, Drew Jones, kvm-ppc, Paolo Bonzini,
	rkrcmar, Cédric Le Goater

ld 2.28 complains with :

  ld -EL -nostdlib -pie -o powerpc/selftest.elf \
          -T powerpc/flat.lds --build-id=none \
          powerpc/selftest.o powerpc/cstart64.o powerpc/reloc64.o lib/libcflat.a lib/libfdt/libfdt.a powerpc/selftest.aux.o
  ld: powerpc/selftest.elf: Not enough room for program headers, try linking with -N
  ld: final link failed: Bad value

Fix that by turning off page alignment of sections with option '-n'

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 powerpc/Makefile.common | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/powerpc/Makefile.common b/powerpc/Makefile.common
index 37f8caa720b7..1869f449b9ac 100644
--- a/powerpc/Makefile.common
+++ b/powerpc/Makefile.common
@@ -42,7 +42,7 @@ cflatobjs += lib/powerpc/smp.o
 
 FLATLIBS = $(libcflat) $(LIBFDT_archive)
 %.elf: CFLAGS += $(arch_CFLAGS)
-%.elf: LDFLAGS = $(arch_LDFLAGS) -nostdlib -pie
+%.elf: LDFLAGS = $(arch_LDFLAGS) -nostdlib -pie -n
 %.elf: %.o $(FLATLIBS) powerpc/flat.lds $(cstart.o) $(reloc.o)
 	$(CC) $(CFLAGS) -c -o $(@:.elf=.aux.o) lib/auxinfo.c -DPROGNAME=\"$@\"
 	$(LD) $(LDFLAGS) -o $@ \
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-15 17:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-10 10:30 [kvm-unit-tests PATCH] powerpc: add -n to LDFLAGS Cédric Le Goater
2017-03-10 10:45 ` Thomas Huth
2017-03-15 17:11 ` Radim Krčmář

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox