summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel@rtems.org>2016-03-11 16:07:35 -0600
committerJoel Sherrill <joel@rtems.org>2016-03-11 16:07:35 -0600
commit5e368e8441e21e484a09e0d743a5b6b934e45047 (patch)
tree36587d42b3689ea627bf739224b7aee647bd891c
parentlm32/shared/.../ckinit.c: Fix typo so fast idle on simulator is enabled (diff)
downloadrtems-5e368e8441e21e484a09e0d743a5b6b934e45047.tar.bz2
pc386: Fix linker usage issues with -r and function sections
closes #2638.
-rw-r--r--c/src/lib/libbsp/i386/pc386/Makefile.am4
-rw-r--r--c/src/lib/libbsp/i386/pc386/make/custom/pc386.cfg6
2 files changed, 7 insertions, 3 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/Makefile.am b/c/src/lib/libbsp/i386/pc386/Makefile.am
index c54307f28c..f79148b048 100644
--- a/c/src/lib/libbsp/i386/pc386/Makefile.am
+++ b/c/src/lib/libbsp/i386/pc386/Makefile.am
@@ -201,6 +201,7 @@ noinst_PROGRAMS += ne2000.rel
ne2000_rel_SOURCES = ne2000/ne2000.c
ne2000_rel_CPPFLAGS = $(AM_CPPFLAGS) $(ne2000_CPPFLAGS)
ne2000_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+ne2000_rel_LDFLAGS += -Wl,--undefined=rtems_ne_driver_attach
endif
if HAS_NETWORKING
@@ -214,6 +215,7 @@ wd8003_rel_SOURCES = wd8003/wd8003.c
wd8003_rel_SOURCES += include/wd80x3.h
wd8003_rel_CPPFLAGS = $(AM_CPPFLAGS) $(wd8003_CPPFLAGS)
wd8003_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+wd8003_rel_LDFLAGS += -Wl,--undefined=rtems_wd_driver_attach
endif
if HAS_NETWORKING
@@ -225,6 +227,8 @@ noinst_PROGRAMS += 3c509.rel
3c509_rel_SOURCES += 3c509/elink.h
3c509_rel_CPPFLAGS = $(AM_CPPFLAGS) $(3c509_CPPFLAGS)
3c509_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+3c509_rel_LDFLAGS += -Wl,--undefined=rtems_3c509_driver_attach
+3c509_rel_LDFLAGS += -Wl,--undefined=ep_board
endif
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/cache.rel
diff --git a/c/src/lib/libbsp/i386/pc386/make/custom/pc386.cfg b/c/src/lib/libbsp/i386/pc386/make/custom/pc386.cfg
index af912e7563..c87870410e 100644
--- a/c/src/lib/libbsp/i386/pc386/make/custom/pc386.cfg
+++ b/c/src/lib/libbsp/i386/pc386/make/custom/pc386.cfg
@@ -20,9 +20,9 @@ endif
# optimize flag: typically -O2
CFLAGS_OPTIMIZE_V = -O2 -g
# Per function sections disabled per https://devel.rtems.org/ticket/2638
-# CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
-#
-# LDFLAGS = -Wl,--gc-sections
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections
# Here is the rule to actually build a $(ARCH)/foo$(EXEEXT)
# It also builds $(ARCH)/foo.sr and $(ARCH)/foo.nm