summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorAndy Fiddaman <omnios@citrus-it.co.uk>2019-11-24 23:09:59 +0000
committerAndy Fiddaman <omnios@citrus-it.co.uk>2019-11-26 15:59:35 +0000
commitf52943a93040563107b95bccb9db87d9971ef47d (patch)
tree88ca9fa3114e3a336c76caa93b5d684a78e854d1 /usr/src
parenta64e1e23aa6dde2e865402bb20dde999f835fdc5 (diff)
downloadillumos-joyent-f52943a93040563107b95bccb9db87d9971ef47d.tar.gz
12016 Use of GNU ld should explicitly specify the required output format
Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Matthias Scheler <matthias.scheler@wdc.com> Approved by: Robert Mustacchi <rm@fingolfin.org>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/boot/sys/boot/Makefile.inc4
-rw-r--r--usr/src/boot/sys/boot/i386/btx/btx/Makefile3
-rw-r--r--usr/src/boot/sys/boot/i386/btx/btxldr/Makefile3
-rw-r--r--usr/src/boot/sys/boot/i386/btx/lib/Makefile3
-rw-r--r--usr/src/boot/sys/boot/i386/cdboot/Makefile4
-rw-r--r--usr/src/boot/sys/boot/i386/pmbr/Makefile3
-rw-r--r--usr/src/grub/grub-0.97/Makefile.solaris.defs2
-rw-r--r--usr/src/grub/grub-0.97/stage1/Makefile.solaris5
-rw-r--r--usr/src/grub/grub-0.97/stage2/Makefile.solaris21
9 files changed, 29 insertions, 19 deletions
diff --git a/usr/src/boot/sys/boot/Makefile.inc b/usr/src/boot/sys/boot/Makefile.inc
index 624d4e912c..4d030cdb59 100644
--- a/usr/src/boot/sys/boot/Makefile.inc
+++ b/usr/src/boot/sys/boot/Makefile.inc
@@ -12,6 +12,7 @@
#
# Copyright 2017 Toomas Soome <tsoome@me.com>
# Copyright 2019 Joyent, Inc.
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
# loader.help build needs better awk
@@ -21,6 +22,9 @@ OBJCOPY= $(GNU_ROOT)/bin/gobjcopy
OBJDUMP= $(GNU_ROOT)/bin/gobjdump
GSTRIP= $(GNU_ROOT)/bin/gstrip
+GLDTARGET= -melf_i386_sol2
+LDFLAGS += $(GLDTARGET)
+
# Default Console font setup.
# We want it to be the same as kernel.
# We build compressed, stripped down version of the default font, so we have
diff --git a/usr/src/boot/sys/boot/i386/btx/btx/Makefile b/usr/src/boot/sys/boot/i386/btx/btx/Makefile
index a83818bab6..da8b3e7d4f 100644
--- a/usr/src/boot/sys/boot/i386/btx/btx/Makefile
+++ b/usr/src/boot/sys/boot/i386/btx/btx/Makefile
@@ -11,6 +11,7 @@
#
# Copyright 2015 Toomas Soome <tsoome@me.com>
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
include $(SRC)/Makefile.master
@@ -41,7 +42,7 @@ CPPFLAGS += -I./../../common
ORG= 0x9000
-LDFLAGS=-e start -Ttext ${ORG} -N -S --oformat binary
+LDFLAGS=-e start -Ttext ${ORG} -N -S --oformat binary $(GLDTARGET)
all install: $(PROG)
diff --git a/usr/src/boot/sys/boot/i386/btx/btxldr/Makefile b/usr/src/boot/sys/boot/i386/btx/btxldr/Makefile
index b68ebcafe4..c209ba4ab4 100644
--- a/usr/src/boot/sys/boot/i386/btx/btxldr/Makefile
+++ b/usr/src/boot/sys/boot/i386/btx/btxldr/Makefile
@@ -11,6 +11,7 @@
#
# Copyright 2015 Toomas Soome <tsoome@me.com>
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
include $(SRC)/Makefile.master
@@ -25,7 +26,7 @@ CPPFLAGS += -DLOADER_ADDRESS=${LOADER_ADDRESS}
CPPFLAGS += -DBTXLDR_VERBOSE
CPPFLAGS += -I./../../common
-LDFLAGS=-e start -Ttext ${LOADER_ADDRESS} -N -S --oformat binary
+LDFLAGS=-e start -Ttext ${LOADER_ADDRESS} -N -S --oformat binary $(GLDTARGET)
all install: $(PROG)
diff --git a/usr/src/boot/sys/boot/i386/btx/lib/Makefile b/usr/src/boot/sys/boot/i386/btx/lib/Makefile
index 0c797d37e5..864a519441 100644
--- a/usr/src/boot/sys/boot/i386/btx/lib/Makefile
+++ b/usr/src/boot/sys/boot/i386/btx/lib/Makefile
@@ -11,6 +11,7 @@
#
# Copyright 2015 Toomas Soome <tsoome@me.com>
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
include $(SRC)/Makefile.master
@@ -23,7 +24,7 @@ PROG= crt0.o
SRCS= btxcsu.S btxsys.s btxv86.s
OBJS= btxcsu.o btxsys.o btxv86.o
-LDFLAGS =-r
+LDFLAGS = -r $(GLDTARGET)
all install: $(PROG)
diff --git a/usr/src/boot/sys/boot/i386/cdboot/Makefile b/usr/src/boot/sys/boot/i386/cdboot/Makefile
index 490029e558..31e684c922 100644
--- a/usr/src/boot/sys/boot/i386/cdboot/Makefile
+++ b/usr/src/boot/sys/boot/i386/cdboot/Makefile
@@ -11,6 +11,7 @@
#
# Copyright 2015 Toomas Soome <tsoome@me.com>
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
include $(SRC)/Makefile.master
@@ -24,10 +25,9 @@ FILEMODE=0444
SRCS= ${PROG}.S
OBJS= $(SRCS:%.S=%.o)
-
ORG= 0x7c00
-LDFLAGS=-e start -Ttext $(ORG) -N -S --oformat binary
+LDFLAGS=-e start -Ttext $(ORG) -N -S --oformat binary $(GLDTARGET)
all: ${PROG}
diff --git a/usr/src/boot/sys/boot/i386/pmbr/Makefile b/usr/src/boot/sys/boot/i386/pmbr/Makefile
index 0d24fd2e90..b7905c92f2 100644
--- a/usr/src/boot/sys/boot/i386/pmbr/Makefile
+++ b/usr/src/boot/sys/boot/i386/pmbr/Makefile
@@ -11,6 +11,7 @@
#
# Copyright 2015 Toomas Soome <tsoome@me.com>
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
#
@@ -28,7 +29,7 @@ SRCS= $(OBJS:%.o=%.s)
ORG= 0x600
-LDFLAGS=-e start -Ttext ${ORG} -N -S --oformat binary
+LDFLAGS=-e start -Ttext ${ORG} -N -S --oformat binary $(GLDTARGET)
all: $(PROG)
diff --git a/usr/src/grub/grub-0.97/Makefile.solaris.defs b/usr/src/grub/grub-0.97/Makefile.solaris.defs
index faf41925c6..86e79c484b 100644
--- a/usr/src/grub/grub-0.97/Makefile.solaris.defs
+++ b/usr/src/grub/grub-0.97/Makefile.solaris.defs
@@ -2,6 +2,7 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
# Copyright 2016 Nexenta Systems, Inc.
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
include $(SRC)/Makefile.master
@@ -70,6 +71,7 @@ CPPFLAGS = $(DEFS) $(INCLUDES) $(WARNFLAGS) \
$(t.ENVCPPFLAGS4:I,%=-nostdinc -isystem %)
CCLD = $(GNU_ROOT)/bin/gld
+GLDTARGET = -melf_i386_sol2
LDFLAGS = $(BASE_LDFLAGS)
LINKFLAGS = -g
LINK = $(CCLD) $(LINKFLAGS) $(LDFLAGS)
diff --git a/usr/src/grub/grub-0.97/stage1/Makefile.solaris b/usr/src/grub/grub-0.97/stage1/Makefile.solaris
index d5d34b9d1f..2873a21a17 100644
--- a/usr/src/grub/grub-0.97/stage1/Makefile.solaris
+++ b/usr/src/grub/grub-0.97/stage1/Makefile.solaris
@@ -2,7 +2,7 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
include ../../Makefile.grub
include ../Makefile.solaris.defs
@@ -13,10 +13,9 @@ include ../Makefile.solaris.defs
.exec:
$(OBJCOPY) -O binary $< $@
-
INCLUDES = -I. -I..
CCASFLAGS += -O2 -fno-builtin -nostdinc
-LDFLAGS += -nostdlib -N -Ttext 7C00
+LDFLAGS += -nostdlib -N -Ttext 7C00 $(GLDTARGET)
LIBS =
diff --git a/usr/src/grub/grub-0.97/stage2/Makefile.solaris b/usr/src/grub/grub-0.97/stage2/Makefile.solaris
index 925092fd4d..1c70f2a71b 100644
--- a/usr/src/grub/grub-0.97/stage2/Makefile.solaris
+++ b/usr/src/grub/grub-0.97/stage2/Makefile.solaris
@@ -4,6 +4,7 @@
# Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
# Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
# Copyright 2016 Nexenta Systems, Inc.
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
include ../../Makefile.grub
include ../Makefile.solaris.defs
@@ -43,12 +44,12 @@ STAGE2_CFLAGS = -Os -fno-builtin -nostdinc \
$(STAGE2_NETBOOT)STAGE2_CFLAGS += $(NETBOOT_CFLAGS)
#STAGE2_CFLAGS += $(HERCULES_CFLAGS)
-NBLOADER_LINK = -nostdlib -N -Ttext 0
-PRE_STAGE2_LINK = -nostdlib -N -Ttext 8200
-PXELOADER_LINK = -nostdlib -N -Ttext 7C00
-STAGE1_5_LINK = -nostdlib -N -Ttext 2000
-START_ELTORITO_LINK = -nostdlib -N -Ttext 7C00
-START_LINK = -nostdlib -N -Ttext 8000
+NBLOADER_LINK = -nostdlib -N -Ttext 0 $(GLDTARGET)
+PRE_STAGE2_LINK = -nostdlib -N -Ttext 8200 $(GLDTARGET)
+PXELOADER_LINK = -nostdlib -N -Ttext 7C00 $(GLDTARGET)
+STAGE1_5_LINK = -nostdlib -N -Ttext 2000 $(GLDTARGET)
+START_ELTORITO_LINK = -nostdlib -N -Ttext 7C00 $(GLDTARGET)
+START_LINK = -nostdlib -N -Ttext 8000 $(GLDTARGET)
LIBDRIVERS = ../netboot/libdrivers.a
@@ -446,13 +447,13 @@ REISERFS_STAGE1_5_OBJS = reiserfs_stage1_5_exec-bios.o \
reiserfs_stage1_5_exec-fsys_reiserfs.o \
reiserfs_stage1_5_exec-moddiv.o \
reiserfs_stage1_5_exec-stage1_5.o
-
+
$(REISERFS_STAGE1_5_EXEC) := LDFLAGS = $(BASE_LDFLAGS) $(STAGE1_5_LINK)
-
+
$(REISERFS_STAGE1_5_ASMOBJS) := CCASFLAGS = $(BASE_CCASFLAGS) \
$(STAGE1_5_CFLAGS) \
-DFSYS_REISERFS=1 -DNO_BLOCK_FILES=1
-
+
$(REISERFS_STAGE1_5_OBJS) := CFLAGS = $(BASE_CFLAGS) $(STAGE1_5_CFLAGS) \
-DFSYS_REISERFS=1 -DNO_BLOCK_FILES=1
@@ -678,7 +679,7 @@ $(LIBGRUB_OBJS): $$(@:libgrub_a-%.o=%.c)
#
# Diskless
#
-$(DISKLESS_EXEC): $(DISKLESS_ASMOBJS) $(DISKLESS_OBJS)
+$(DISKLESS_EXEC): $(DISKLESS_ASMOBJS) $(DISKLESS_OBJS)
$(RM) $@
$(LINK) -o $@ $(DISKLESS_ASMOBJS) $(DISKLESS_OBJS) $(LIBS)