@@ -507,7 +510,7 @@ cat ../syscall/syscall.csv ../lib/lib.csv | sort >tmp.csv
In this case, it will link together the module's object files (only hello.o
here)
along with the assembled thunk file, hello-thunk.o
to create the second relocatable object,
hello.r2
.
- The linker script, gnu-nxflat.ld
is required at this point to correctly position the sections.
+ The linker script, gnu-nxflat-gotoff.ld
is required at this point to correctly position the sections.
This linker script produces two segments:
An I-Space (Instruction Space) segment containing mostly .text
and a D-Space (Data Space) segment
containing .got
, .data
, and .bss
sections.
@@ -518,6 +521,22 @@ cat ../syscall/syscall.csv ../lib/lib.csv | sort >tmp.csv
The option -no-check-sections
is required to prevent the linker from failing because these segments overlap.
+NOTE:
+ There are two linker scripts located at binfmt/libnxflat/gnu-nxflat-gotoff.ld
.
+
+
+ -
+
binfmt/libnxflat/gnu-nxflat-gotoff.ld
.
+ Older versions of GCC (at least up to GCC 4.3.3), use GOT-relative addressing to access RO data.
+ In that case, read-only data (.rodata) must reside in D-Space and this linker script should be used.
+
+ -
+
binfmt/libnxflat/gnu-nxflat-pcrel.ld
.
+ Newer versions of GCC (at least as of GCC 4.6.3), use PC-relative addressing to access RO data.
+ In that case, read-only data (.rodata) must reside in I-Space and this linker script should be used.
+
+
+
Target 4.
Finally, this target will use the hello.r2
relocatable object to create the final, NXFLAT module
hello
by executing ldnxflat
.
diff --git a/TODO b/TODO
index 72a94290b9..30015ef50b 100644
--- a/TODO
+++ b/TODO
@@ -376,15 +376,15 @@ o Binary loaders (binfmt/)
Description: Windows build issue. Some of the configurations that use NXFLAT have
the linker script specified like this:
- NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+ NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
That will not work for windows-based tools because they require Windows
style paths. The solution is to do something like this:
if ($(WINTOOL)y)
- NXFLATLDSCRIPT=${cygpath -w $(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld}
+ NXFLATLDSCRIPT=${cygpath -w $(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld}
else
- NXFLATLDSCRIPT=$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld
+ NXFLATLDSCRIPT=$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld
endif
Then use
diff --git a/binfmt/libnxflat/gnu-nxflat.ld b/binfmt/libnxflat/gnu-nxflat-gotoff.ld
similarity index 89%
rename from binfmt/libnxflat/gnu-nxflat.ld
rename to binfmt/libnxflat/gnu-nxflat-gotoff.ld
index e66b1dff52..c0487212aa 100644
--- a/binfmt/libnxflat/gnu-nxflat.ld
+++ b/binfmt/libnxflat/gnu-nxflat-gotoff.ld
@@ -1,7 +1,7 @@
/****************************************************************************
- * examples/nxflat/nxflat.ld
+ * examples/nxflat/gnu-nxflat-gotoff.ld
*
- * Copyright (C) 2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Redistribution and use in source and binary forms, with or without
@@ -48,7 +48,17 @@ MEMORY
* (2) DSpace (Data Space). This is the segment that contains both
* read-write data (.data, .bss) as well as read-only data (.rodata).
* Everything in this segment should be access-able with machine
- * with machine load and store instructions.
+ * PIC load and store instructions.
+ *
+ * Older versions of GCC (at least up to GCC 4.3.3), use GOT-relative
+ * addressing to access RO data. In that case, read-only data (.rodata) must
+ * reside in D-Space and this linker script should be used.
+ *
+ * Newer versions of GCC (at least as of GCC 4.6.3), use PC-relative
+ * addressing to access RO data. In that case, read-only data (.rodata) must
+ * reside in I-Space and this linker script should NOT be used with those
+ * newer tools.
+ *
****************************************************************************/
SECTIONS
diff --git a/binfmt/libnxflat/gnu-nxflat-pcrel.ld b/binfmt/libnxflat/gnu-nxflat-pcrel.ld
new file mode 100644
index 0000000000..eb79023d01
--- /dev/null
+++ b/binfmt/libnxflat/gnu-nxflat-pcrel.ld
@@ -0,0 +1,182 @@
+/****************************************************************************
+ * examples/nxflat/gnu-nxflat-pcrel.ld
+ *
+ * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+MEMORY
+{
+ ISPACE : ORIGIN = 0x0, LENGTH = 2097152
+ DSPACE : ORIGIN = 0x0, LENGTH = 2097152
+}
+
+/****************************************************************************
+ * The XFLAT program image is divided into two segments:
+ *
+ * (1) ISpace (Instruction Space). This is the segment that contains
+ * code (.text) as well as read-only data (.rodata). Everything in the
+ * segment should be fetch-able machine PC instructions (jump, branch,
+ * call, etc.) or PC-relative loads.
+ * (2) DSpace (Data Space). This is the segment that contains read-write
+ * data (.data, .bss). Everything in this segment should be access-able
+ * with machine PIC load and store instructions.
+ *
+ * Older versions of GCC (at least up to GCC 4.3.3), use GOT-relative
+ * addressing to access RO data. In that case, read-only data (.rodata) must
+ * reside in D-Space and this linker script should NOT be used with those
+ * older tools.
+ *
+ * Newer versions of GCC (at least as of GCC 4.6.3), use PC-relative
+ * addressing to access RO data. In that case, read-only data (.rodata) must
+ * reside in I-Space and this linker script should be used.
+ *
+ ****************************************************************************/
+
+SECTIONS
+{
+ .text 0x00000000 :
+ {
+ /* ISpace is located at address 0. Every (unrelocated) ISpace
+ * address is an offset from the begining of this segment.
+ */
+
+ text_start = . ;
+
+ *(.text)
+ *(.text.*)
+ *(.gnu.warning)
+ *(.stub)
+ *(.glue_7)
+ *(.glue_7t)
+ *(.jcr)
+
+ /* C++ support: The .init and .fini sections contain XFLAT-
+ * specific logic to manage static constructors and destructors.
+ */
+
+ *(.gnu.linkonce.t.*)
+ *(.init)
+ *(.fini)
+
+ /* This is special code area at the end of the normal
+ text section. It contains a small lookup table at
+ the start followed by the code pointed to by entries
+ in the lookup table. */
+
+ . = ALIGN (4) ;
+ PROVIDE(__ctbp = .);
+ *(.call_table_data)
+ *(.call_table_text)
+
+ _etext = . ;
+
+ } > ISPACE
+
+ /* DSpace is also located at address 0. Every (unrelocated) DSpace
+ * address is an offset from the begining of this segment.
+ */
+
+ .data 0x00000000 :
+ {
+ __data_start = . ;
+ *(.rodata)
+ *(.rodata1)
+ *(.rodata.*)
+ *(.gnu.linkonce.r*)
+ *(.data)
+ *(.data1)
+ *(.data.*)
+ *(.gnu.linkonce.d*)
+ *(.data1)
+ *(.eh_frame)
+ *(.gcc_except_table)
+
+ *(.gnu.linkonce.s.*)
+ *(__libc_atexit)
+ *(__libc_subinit)
+ *(__libc_subfreeres)
+ *(.note.ABI-tag)
+
+ /* C++ support. For each global and static local C++ object,
+ * GCC creates a small subroutine to construct the object. Pointers
+ * to these routines (not the routines themselves) are stored as
+ * simple, linear arrays in the .ctors section of the object file.
+ * Similarly, pointers to global/static destructor routines are
+ * stored in .dtors.
+ */
+
+ *(.gnu.linkonce.d.*)
+
+ _ctors_start = . ;
+ *(.ctors)
+ _ctors_end = . ;
+ _dtors_start = . ;
+ *(.dtors)
+ _dtors_end = . ;
+
+ _edata = . ;
+ edata = ALIGN( 0x10 ) ;
+ } > DSPACE
+
+ .bss :
+ {
+ __bss_start = _edata ;
+ *(.dynsbss)
+ *(.sbss)
+ *(.sbss.*)
+ *(.scommon)
+ *(.dynbss)
+ *(.bss)
+ *(.bss.*)
+ *(.bss*)
+ *(.gnu.linkonce.b*)
+ *(COMMON)
+ end = ALIGN( 0x10 ) ;
+ _end = ALIGN( 0x10 ) ;
+ } > DSPACE
+
+ .got 0 : { *(.got.plt) *(.got) }
+ .junk 0 : { *(.rel*) *(.rela*) }
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_info 0 : { *(.debug_info) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ .debug_aranges 0 : { *(.debug_aranges) }
+}
diff --git a/configs/amber/hello/Make.defs b/configs/amber/hello/Make.defs
index 66f3ff7993..1c2d8b89e1 100644
--- a/configs/amber/hello/Make.defs
+++ b/configs/amber/hello/Make.defs
@@ -107,7 +107,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/c5471evm/httpd/Make.defs b/configs/c5471evm/httpd/Make.defs
index ffc267530d..4d94d83427 100644
--- a/configs/c5471evm/httpd/Make.defs
+++ b/configs/c5471evm/httpd/Make.defs
@@ -74,7 +74,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/c5471evm/nettest/Make.defs b/configs/c5471evm/nettest/Make.defs
index e784c11194..1f8b7afa17 100644
--- a/configs/c5471evm/nettest/Make.defs
+++ b/configs/c5471evm/nettest/Make.defs
@@ -74,7 +74,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/c5471evm/nsh/Make.defs b/configs/c5471evm/nsh/Make.defs
index d9e569158b..68a15703e3 100644
--- a/configs/c5471evm/nsh/Make.defs
+++ b/configs/c5471evm/nsh/Make.defs
@@ -74,7 +74,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/c5471evm/ostest/Make.defs b/configs/c5471evm/ostest/Make.defs
index 9cbfc1d1d5..8a0f8c812f 100644
--- a/configs/c5471evm/ostest/Make.defs
+++ b/configs/c5471evm/ostest/Make.defs
@@ -74,7 +74,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/compal_e88/nsh_highram/Make.defs b/configs/compal_e88/nsh_highram/Make.defs
index e99d5635d0..c5890828f8 100644
--- a/configs/compal_e88/nsh_highram/Make.defs
+++ b/configs/compal_e88/nsh_highram/Make.defs
@@ -83,7 +83,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/compal_e99/nsh_compalram/Make.defs b/configs/compal_e99/nsh_compalram/Make.defs
index 4759fc76a4..16e38b666b 100644
--- a/configs/compal_e99/nsh_compalram/Make.defs
+++ b/configs/compal_e99/nsh_compalram/Make.defs
@@ -83,7 +83,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/compal_e99/nsh_highram/Make.defs b/configs/compal_e99/nsh_highram/Make.defs
index e99d5635d0..c5890828f8 100644
--- a/configs/compal_e99/nsh_highram/Make.defs
+++ b/configs/compal_e99/nsh_highram/Make.defs
@@ -83,7 +83,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/demo9s12ne64/ostest/Make.defs b/configs/demo9s12ne64/ostest/Make.defs
index 727ebb5614..9edf5adf9c 100644
--- a/configs/demo9s12ne64/ostest/Make.defs
+++ b/configs/demo9s12ne64/ostest/Make.defs
@@ -105,7 +105,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/ea3131/nsh/Make.defs b/configs/ea3131/nsh/Make.defs
index cd49f56af7..28e881ccb4 100644
--- a/configs/ea3131/nsh/Make.defs
+++ b/configs/ea3131/nsh/Make.defs
@@ -115,7 +115,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/ea3131/ostest/Make.defs b/configs/ea3131/ostest/Make.defs
index f07f4d4529..ed7eb92903 100644
--- a/configs/ea3131/ostest/Make.defs
+++ b/configs/ea3131/ostest/Make.defs
@@ -115,7 +115,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/ea3131/pgnsh/Make.defs b/configs/ea3131/pgnsh/Make.defs
index 1097a8d728..7b09759ead 100644
--- a/configs/ea3131/pgnsh/Make.defs
+++ b/configs/ea3131/pgnsh/Make.defs
@@ -115,7 +115,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/ea3131/usbserial/Make.defs b/configs/ea3131/usbserial/Make.defs
index 3fe5f8f931..614221fb37 100644
--- a/configs/ea3131/usbserial/Make.defs
+++ b/configs/ea3131/usbserial/Make.defs
@@ -115,7 +115,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/ea3131/usbstorage/Make.defs b/configs/ea3131/usbstorage/Make.defs
index de351b2567..4aa007069e 100644
--- a/configs/ea3131/usbstorage/Make.defs
+++ b/configs/ea3131/usbstorage/Make.defs
@@ -115,7 +115,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/ea3152/ostest/Make.defs b/configs/ea3152/ostest/Make.defs
index 9bb350e36c..8ca8f6e6a9 100644
--- a/configs/ea3152/ostest/Make.defs
+++ b/configs/ea3152/ostest/Make.defs
@@ -115,7 +115,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/eagle100/README.txt b/configs/eagle100/README.txt
index 105bd5ff18..b4bca39cb6 100644
--- a/configs/eagle100/README.txt
+++ b/configs/eagle100/README.txt
@@ -157,12 +157,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
^^^^^^^^^^^^^^^^
diff --git a/configs/eagle100/httpd/Make.defs b/configs/eagle100/httpd/Make.defs
index 8d3cc9c25f..dc252dfb3a 100644
--- a/configs/eagle100/httpd/Make.defs
+++ b/configs/eagle100/httpd/Make.defs
@@ -98,7 +98,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/eagle100/nettest/Make.defs b/configs/eagle100/nettest/Make.defs
index ca50492828..3de14846e6 100644
--- a/configs/eagle100/nettest/Make.defs
+++ b/configs/eagle100/nettest/Make.defs
@@ -98,7 +98,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/eagle100/nsh/Make.defs b/configs/eagle100/nsh/Make.defs
index 4992994951..ff66759339 100644
--- a/configs/eagle100/nsh/Make.defs
+++ b/configs/eagle100/nsh/Make.defs
@@ -98,7 +98,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/eagle100/nxflat/Make.defs b/configs/eagle100/nxflat/Make.defs
index d735c3942a..41e738ec8b 100644
--- a/configs/eagle100/nxflat/Make.defs
+++ b/configs/eagle100/nxflat/Make.defs
@@ -101,7 +101,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/eagle100/ostest/Make.defs b/configs/eagle100/ostest/Make.defs
index 641fcbaba2..78db5644e4 100644
--- a/configs/eagle100/ostest/Make.defs
+++ b/configs/eagle100/ostest/Make.defs
@@ -98,7 +98,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/eagle100/thttpd/Make.defs b/configs/eagle100/thttpd/Make.defs
index 999db3a591..92f68d9f11 100644
--- a/configs/eagle100/thttpd/Make.defs
+++ b/configs/eagle100/thttpd/Make.defs
@@ -101,7 +101,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/ekk-lm3s9b96/README.txt b/configs/ekk-lm3s9b96/README.txt
index 16568dbda2..2ad4354779 100644
--- a/configs/ekk-lm3s9b96/README.txt
+++ b/configs/ekk-lm3s9b96/README.txt
@@ -235,12 +235,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
^^^^^^^^^^^^^^^^
diff --git a/configs/ekk-lm3s9b96/nsh/Make.defs b/configs/ekk-lm3s9b96/nsh/Make.defs
index e810ec175a..c14dccbb91 100644
--- a/configs/ekk-lm3s9b96/nsh/Make.defs
+++ b/configs/ekk-lm3s9b96/nsh/Make.defs
@@ -118,7 +118,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/ekk-lm3s9b96/ostest/Make.defs b/configs/ekk-lm3s9b96/ostest/Make.defs
index ca38be836c..4068b73fd4 100644
--- a/configs/ekk-lm3s9b96/ostest/Make.defs
+++ b/configs/ekk-lm3s9b96/ostest/Make.defs
@@ -118,7 +118,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/fire-stm32v2/README.txt b/configs/fire-stm32v2/README.txt
index 74f3c72948..9e5d94c230 100644
--- a/configs/fire-stm32v2/README.txt
+++ b/configs/fire-stm32v2/README.txt
@@ -357,12 +357,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
================
diff --git a/configs/fire-stm32v2/nsh/Make.defs b/configs/fire-stm32v2/nsh/Make.defs
index f64dda4d20..bd63f7c6be 100644
--- a/configs/fire-stm32v2/nsh/Make.defs
+++ b/configs/fire-stm32v2/nsh/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/hymini-stm32v/README.txt b/configs/hymini-stm32v/README.txt
index 03658be0ac..51f3c1fe3b 100644
--- a/configs/hymini-stm32v/README.txt
+++ b/configs/hymini-stm32v/README.txt
@@ -177,12 +177,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
================
diff --git a/configs/hymini-stm32v/buttons/Make.defs b/configs/hymini-stm32v/buttons/Make.defs
index eb121c2cbe..efc29cb1dc 100644
--- a/configs/hymini-stm32v/buttons/Make.defs
+++ b/configs/hymini-stm32v/buttons/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/hymini-stm32v/nsh/Make.defs b/configs/hymini-stm32v/nsh/Make.defs
index a0809f98a0..cade80762c 100644
--- a/configs/hymini-stm32v/nsh/Make.defs
+++ b/configs/hymini-stm32v/nsh/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/hymini-stm32v/nsh2/Make.defs b/configs/hymini-stm32v/nsh2/Make.defs
index 72960ee270..269b4979ea 100644
--- a/configs/hymini-stm32v/nsh2/Make.defs
+++ b/configs/hymini-stm32v/nsh2/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/hymini-stm32v/nx/Make.defs b/configs/hymini-stm32v/nx/Make.defs
index d647c7fcd6..fce4ec279b 100644
--- a/configs/hymini-stm32v/nx/Make.defs
+++ b/configs/hymini-stm32v/nx/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/hymini-stm32v/nxlines/Make.defs b/configs/hymini-stm32v/nxlines/Make.defs
index fa66e6be05..8943c4cb72 100644
--- a/configs/hymini-stm32v/nxlines/Make.defs
+++ b/configs/hymini-stm32v/nxlines/Make.defs
@@ -131,7 +131,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/hymini-stm32v/usbserial/Make.defs b/configs/hymini-stm32v/usbserial/Make.defs
index d0a2a80cc3..1e8c90b123 100644
--- a/configs/hymini-stm32v/usbserial/Make.defs
+++ b/configs/hymini-stm32v/usbserial/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/hymini-stm32v/usbstorage/Make.defs b/configs/hymini-stm32v/usbstorage/Make.defs
index ee870eab44..8acc8db4aa 100644
--- a/configs/hymini-stm32v/usbstorage/Make.defs
+++ b/configs/hymini-stm32v/usbstorage/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/kwikstik-k40/README.txt b/configs/kwikstik-k40/README.txt
index a320cbb054..246fa912e6 100644
--- a/configs/kwikstik-k40/README.txt
+++ b/configs/kwikstik-k40/README.txt
@@ -300,12 +300,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
================
diff --git a/configs/kwikstik-k40/ostest/Make.defs b/configs/kwikstik-k40/ostest/Make.defs
index beba9e3978..a51f37e94f 100644
--- a/configs/kwikstik-k40/ostest/Make.defs
+++ b/configs/kwikstik-k40/ostest/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/lincoln60/README.txt b/configs/lincoln60/README.txt
index abbc572046..35fe32267c 100644
--- a/configs/lincoln60/README.txt
+++ b/configs/lincoln60/README.txt
@@ -199,12 +199,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conerntions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
^^^^^^^^^^^^^^^^
diff --git a/configs/lincoln60/nsh/Make.defs b/configs/lincoln60/nsh/Make.defs
index 7b3c3318a6..cf76f97f28 100644
--- a/configs/lincoln60/nsh/Make.defs
+++ b/configs/lincoln60/nsh/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/lincoln60/ostest/Make.defs b/configs/lincoln60/ostest/Make.defs
index bd4b25701b..044b27dc43 100644
--- a/configs/lincoln60/ostest/Make.defs
+++ b/configs/lincoln60/ostest/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/lm3s6432-s2e/README.txt b/configs/lm3s6432-s2e/README.txt
index 10ceda15ac..460b5546d7 100644
--- a/configs/lm3s6432-s2e/README.txt
+++ b/configs/lm3s6432-s2e/README.txt
@@ -229,12 +229,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
^^^^^^^^^^^^^^^^
diff --git a/configs/lm3s6432-s2e/nsh/Make.defs b/configs/lm3s6432-s2e/nsh/Make.defs
index e463a17429..c9ade8028a 100644
--- a/configs/lm3s6432-s2e/nsh/Make.defs
+++ b/configs/lm3s6432-s2e/nsh/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/lm3s6432-s2e/ostest/Make.defs b/configs/lm3s6432-s2e/ostest/Make.defs
index 33f0d43ede..5f48145bfd 100644
--- a/configs/lm3s6432-s2e/ostest/Make.defs
+++ b/configs/lm3s6432-s2e/ostest/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/lm3s6965-ek/README.txt b/configs/lm3s6965-ek/README.txt
index fc70b75fc0..4aba09beeb 100644
--- a/configs/lm3s6965-ek/README.txt
+++ b/configs/lm3s6965-ek/README.txt
@@ -261,12 +261,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
^^^^^^^^^^^^^^^^
diff --git a/configs/lm3s6965-ek/nsh/Make.defs b/configs/lm3s6965-ek/nsh/Make.defs
index 5aaed90095..6fc8616aab 100644
--- a/configs/lm3s6965-ek/nsh/Make.defs
+++ b/configs/lm3s6965-ek/nsh/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/lm3s6965-ek/nx/Make.defs b/configs/lm3s6965-ek/nx/Make.defs
index 8b99d7de7f..887bb823a3 100644
--- a/configs/lm3s6965-ek/nx/Make.defs
+++ b/configs/lm3s6965-ek/nx/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/lm3s6965-ek/ostest/Make.defs b/configs/lm3s6965-ek/ostest/Make.defs
index 434b21e24a..0c02e22bb0 100644
--- a/configs/lm3s6965-ek/ostest/Make.defs
+++ b/configs/lm3s6965-ek/ostest/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/lm3s8962-ek/README.txt b/configs/lm3s8962-ek/README.txt
index 043e5ceb38..570d158a29 100644
--- a/configs/lm3s8962-ek/README.txt
+++ b/configs/lm3s8962-ek/README.txt
@@ -245,12 +245,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
^^^^^^^^^^^^^^^^
diff --git a/configs/lm3s8962-ek/nsh/Make.defs b/configs/lm3s8962-ek/nsh/Make.defs
index d7be642cd4..671ccec32b 100644
--- a/configs/lm3s8962-ek/nsh/Make.defs
+++ b/configs/lm3s8962-ek/nsh/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/lm3s8962-ek/nx/Make.defs b/configs/lm3s8962-ek/nx/Make.defs
index bf07df29a6..2563c58dd9 100644
--- a/configs/lm3s8962-ek/nx/Make.defs
+++ b/configs/lm3s8962-ek/nx/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/lm3s8962-ek/ostest/Make.defs b/configs/lm3s8962-ek/ostest/Make.defs
index 94389216cd..2559ed89a1 100644
--- a/configs/lm3s8962-ek/ostest/Make.defs
+++ b/configs/lm3s8962-ek/ostest/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/lpc4330-xplorer/README.txt b/configs/lpc4330-xplorer/README.txt
index a613edada1..ea1098be54 100644
--- a/configs/lpc4330-xplorer/README.txt
+++ b/configs/lpc4330-xplorer/README.txt
@@ -511,12 +511,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
================
diff --git a/configs/lpc4330-xplorer/nsh/Make.defs b/configs/lpc4330-xplorer/nsh/Make.defs
index 757759ecc9..51439ac227 100644
--- a/configs/lpc4330-xplorer/nsh/Make.defs
+++ b/configs/lpc4330-xplorer/nsh/Make.defs
@@ -174,7 +174,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/lpc4330-xplorer/ostest/Make.defs b/configs/lpc4330-xplorer/ostest/Make.defs
index 757759ecc9..51439ac227 100644
--- a/configs/lpc4330-xplorer/ostest/Make.defs
+++ b/configs/lpc4330-xplorer/ostest/Make.defs
@@ -174,7 +174,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/lpcxpresso-lpc1768/README.txt b/configs/lpcxpresso-lpc1768/README.txt
index 65f58d5527..cbc5f50e8c 100644
--- a/configs/lpcxpresso-lpc1768/README.txt
+++ b/configs/lpcxpresso-lpc1768/README.txt
@@ -455,12 +455,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
^^^^^^^^^^^^^^^^
diff --git a/configs/lpcxpresso-lpc1768/dhcpd/Make.defs b/configs/lpcxpresso-lpc1768/dhcpd/Make.defs
index 15109a1adb..55da02a154 100644
--- a/configs/lpcxpresso-lpc1768/dhcpd/Make.defs
+++ b/configs/lpcxpresso-lpc1768/dhcpd/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/lpcxpresso-lpc1768/nsh/Make.defs b/configs/lpcxpresso-lpc1768/nsh/Make.defs
index b29d10982f..52831a2794 100644
--- a/configs/lpcxpresso-lpc1768/nsh/Make.defs
+++ b/configs/lpcxpresso-lpc1768/nsh/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/lpcxpresso-lpc1768/nx/Make.defs b/configs/lpcxpresso-lpc1768/nx/Make.defs
index 31286436a8..59aeb51875 100644
--- a/configs/lpcxpresso-lpc1768/nx/Make.defs
+++ b/configs/lpcxpresso-lpc1768/nx/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/lpcxpresso-lpc1768/ostest/Make.defs b/configs/lpcxpresso-lpc1768/ostest/Make.defs
index 975cdf4601..6d228a9363 100644
--- a/configs/lpcxpresso-lpc1768/ostest/Make.defs
+++ b/configs/lpcxpresso-lpc1768/ostest/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/lpcxpresso-lpc1768/thttpd/Make.defs b/configs/lpcxpresso-lpc1768/thttpd/Make.defs
index 67534a5c1e..b6a3245469 100644
--- a/configs/lpcxpresso-lpc1768/thttpd/Make.defs
+++ b/configs/lpcxpresso-lpc1768/thttpd/Make.defs
@@ -88,14 +88,14 @@ ifeq ($(WINTOOL),y)
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/thttpd/ld.script}"
MAXOPTIMIZATION = -O2
- NXFLATLDSCRIPT = -T "${shell cygpath -w $(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld}"
+ NXFLATLDSCRIPT = -T "${shell cygpath -w $(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld}"
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/thttpd/ld.script
- NXFLATLDSCRIPT = -T"$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld"
+ NXFLATLDSCRIPT = -T"$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld"
endif
CC = $(CROSSDEV)gcc
diff --git a/configs/lpcxpresso-lpc1768/usbstorage/Make.defs b/configs/lpcxpresso-lpc1768/usbstorage/Make.defs
index 087a922871..793dfcdf19 100644
--- a/configs/lpcxpresso-lpc1768/usbstorage/Make.defs
+++ b/configs/lpcxpresso-lpc1768/usbstorage/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/mbed/README.txt b/configs/mbed/README.txt
index 601c9a0b25..df509a199a 100644
--- a/configs/mbed/README.txt
+++ b/configs/mbed/README.txt
@@ -169,12 +169,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
^^^^^^^^^^^^^^^^
diff --git a/configs/mbed/hidkbd/Make.defs b/configs/mbed/hidkbd/Make.defs
index 043340da13..b1dfb73e12 100644
--- a/configs/mbed/hidkbd/Make.defs
+++ b/configs/mbed/hidkbd/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/mbed/nsh/Make.defs b/configs/mbed/nsh/Make.defs
index 549178e9cb..f1983a7b7c 100644
--- a/configs/mbed/nsh/Make.defs
+++ b/configs/mbed/nsh/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/mcu123-lpc214x/composite/Make.defs b/configs/mcu123-lpc214x/composite/Make.defs
index f2f0ee8e88..fcbc0b8090 100644
--- a/configs/mcu123-lpc214x/composite/Make.defs
+++ b/configs/mcu123-lpc214x/composite/Make.defs
@@ -110,7 +110,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/mcu123-lpc214x/nsh/Make.defs b/configs/mcu123-lpc214x/nsh/Make.defs
index de09916e5f..eed15974a1 100644
--- a/configs/mcu123-lpc214x/nsh/Make.defs
+++ b/configs/mcu123-lpc214x/nsh/Make.defs
@@ -110,7 +110,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/mcu123-lpc214x/ostest/Make.defs b/configs/mcu123-lpc214x/ostest/Make.defs
index bc72ca9bdc..46beab5265 100644
--- a/configs/mcu123-lpc214x/ostest/Make.defs
+++ b/configs/mcu123-lpc214x/ostest/Make.defs
@@ -110,7 +110,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/mcu123-lpc214x/usbserial/Make.defs b/configs/mcu123-lpc214x/usbserial/Make.defs
index 106224ef12..377c39b1d4 100644
--- a/configs/mcu123-lpc214x/usbserial/Make.defs
+++ b/configs/mcu123-lpc214x/usbserial/Make.defs
@@ -110,7 +110,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/mcu123-lpc214x/usbstorage/Make.defs b/configs/mcu123-lpc214x/usbstorage/Make.defs
index bf1b9cab45..d26a22d6fc 100644
--- a/configs/mcu123-lpc214x/usbstorage/Make.defs
+++ b/configs/mcu123-lpc214x/usbstorage/Make.defs
@@ -110,7 +110,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/micropendous3/hello/Make.defs b/configs/micropendous3/hello/Make.defs
index 178f355567..bd48d79c9e 100644
--- a/configs/micropendous3/hello/Make.defs
+++ b/configs/micropendous3/hello/Make.defs
@@ -107,7 +107,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/mirtoo/nsh/Make.defs b/configs/mirtoo/nsh/Make.defs
index 17b7cad213..de0a190f66 100644
--- a/configs/mirtoo/nsh/Make.defs
+++ b/configs/mirtoo/nsh/Make.defs
@@ -154,7 +154,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/mirtoo/nxffs/Make.defs b/configs/mirtoo/nxffs/Make.defs
index 908536b66c..a6992ee533 100644
--- a/configs/mirtoo/nxffs/Make.defs
+++ b/configs/mirtoo/nxffs/Make.defs
@@ -154,7 +154,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/mirtoo/ostest/Make.defs b/configs/mirtoo/ostest/Make.defs
index 7c200ea47b..71bd9d5baa 100644
--- a/configs/mirtoo/ostest/Make.defs
+++ b/configs/mirtoo/ostest/Make.defs
@@ -154,7 +154,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/mx1ads/ostest/Make.defs b/configs/mx1ads/ostest/Make.defs
index 71e053b0aa..9b9c61df8f 100644
--- a/configs/mx1ads/ostest/Make.defs
+++ b/configs/mx1ads/ostest/Make.defs
@@ -84,7 +84,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/ne64badge/ostest/Make.defs b/configs/ne64badge/ostest/Make.defs
index 9521a0a660..2858d30f1d 100644
--- a/configs/ne64badge/ostest/Make.defs
+++ b/configs/ne64badge/ostest/Make.defs
@@ -105,7 +105,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/ntosd-dm320/nettest/Make.defs b/configs/ntosd-dm320/nettest/Make.defs
index 30d369c2ac..e28c1a3609 100644
--- a/configs/ntosd-dm320/nettest/Make.defs
+++ b/configs/ntosd-dm320/nettest/Make.defs
@@ -120,7 +120,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/ntosd-dm320/nsh/Make.defs b/configs/ntosd-dm320/nsh/Make.defs
index 14038f7562..aff7f4240b 100644
--- a/configs/ntosd-dm320/nsh/Make.defs
+++ b/configs/ntosd-dm320/nsh/Make.defs
@@ -120,7 +120,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/ntosd-dm320/ostest/Make.defs b/configs/ntosd-dm320/ostest/Make.defs
index 4618c42467..6766b49153 100644
--- a/configs/ntosd-dm320/ostest/Make.defs
+++ b/configs/ntosd-dm320/ostest/Make.defs
@@ -120,7 +120,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/ntosd-dm320/poll/Make.defs b/configs/ntosd-dm320/poll/Make.defs
index c06139bd6d..a111fed657 100644
--- a/configs/ntosd-dm320/poll/Make.defs
+++ b/configs/ntosd-dm320/poll/Make.defs
@@ -120,7 +120,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/ntosd-dm320/thttpd/Make.defs b/configs/ntosd-dm320/thttpd/Make.defs
index 075f72eaa2..a0e501376e 100644
--- a/configs/ntosd-dm320/thttpd/Make.defs
+++ b/configs/ntosd-dm320/thttpd/Make.defs
@@ -120,7 +120,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/ntosd-dm320/udp/Make.defs b/configs/ntosd-dm320/udp/Make.defs
index 66750f13d6..16ed8ecebf 100644
--- a/configs/ntosd-dm320/udp/Make.defs
+++ b/configs/ntosd-dm320/udp/Make.defs
@@ -120,7 +120,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/ntosd-dm320/uip/Make.defs b/configs/ntosd-dm320/uip/Make.defs
index d59b96e7c7..d9425c05eb 100644
--- a/configs/ntosd-dm320/uip/Make.defs
+++ b/configs/ntosd-dm320/uip/Make.defs
@@ -120,7 +120,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/nucleus2g/README.txt b/configs/nucleus2g/README.txt
index 01b6adef71..39ae370ccc 100644
--- a/configs/nucleus2g/README.txt
+++ b/configs/nucleus2g/README.txt
@@ -229,12 +229,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
^^^^^^^^^^^^^^^^
diff --git a/configs/nucleus2g/nsh/Make.defs b/configs/nucleus2g/nsh/Make.defs
index e21f7f1c88..85e175df0d 100644
--- a/configs/nucleus2g/nsh/Make.defs
+++ b/configs/nucleus2g/nsh/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/nucleus2g/ostest/Make.defs b/configs/nucleus2g/ostest/Make.defs
index 5696eae227..fc12eccad0 100644
--- a/configs/nucleus2g/ostest/Make.defs
+++ b/configs/nucleus2g/ostest/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/nucleus2g/usbserial/Make.defs b/configs/nucleus2g/usbserial/Make.defs
index 2cdccc9596..d82b5d1bcc 100644
--- a/configs/nucleus2g/usbserial/Make.defs
+++ b/configs/nucleus2g/usbserial/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/nucleus2g/usbstorage/Make.defs b/configs/nucleus2g/usbstorage/Make.defs
index 79f1b8c1f4..d5819e82a7 100644
--- a/configs/nucleus2g/usbstorage/Make.defs
+++ b/configs/nucleus2g/usbstorage/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/olimex-lpc1766stk/README.txt b/configs/olimex-lpc1766stk/README.txt
index 96692688c5..dcea9d0b71 100644
--- a/configs/olimex-lpc1766stk/README.txt
+++ b/configs/olimex-lpc1766stk/README.txt
@@ -317,12 +317,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
^^^^^^^^^^^^^^^^
diff --git a/configs/olimex-lpc1766stk/ftpc/Make.defs b/configs/olimex-lpc1766stk/ftpc/Make.defs
index fb8d550235..352c031749 100644
--- a/configs/olimex-lpc1766stk/ftpc/Make.defs
+++ b/configs/olimex-lpc1766stk/ftpc/Make.defs
@@ -120,7 +120,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/olimex-lpc1766stk/hidkbd/Make.defs b/configs/olimex-lpc1766stk/hidkbd/Make.defs
index 1997d66b3b..017a79e7dc 100644
--- a/configs/olimex-lpc1766stk/hidkbd/Make.defs
+++ b/configs/olimex-lpc1766stk/hidkbd/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/olimex-lpc1766stk/nettest/Make.defs b/configs/olimex-lpc1766stk/nettest/Make.defs
index 2036629411..652899c083 100644
--- a/configs/olimex-lpc1766stk/nettest/Make.defs
+++ b/configs/olimex-lpc1766stk/nettest/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/olimex-lpc1766stk/nsh/Make.defs b/configs/olimex-lpc1766stk/nsh/Make.defs
index 7110759bac..b517fae43c 100644
--- a/configs/olimex-lpc1766stk/nsh/Make.defs
+++ b/configs/olimex-lpc1766stk/nsh/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/olimex-lpc1766stk/nx/Make.defs b/configs/olimex-lpc1766stk/nx/Make.defs
index e8325f7808..2d0d63b190 100644
--- a/configs/olimex-lpc1766stk/nx/Make.defs
+++ b/configs/olimex-lpc1766stk/nx/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/olimex-lpc1766stk/ostest/Make.defs b/configs/olimex-lpc1766stk/ostest/Make.defs
index f7775e0727..6883694a3f 100644
--- a/configs/olimex-lpc1766stk/ostest/Make.defs
+++ b/configs/olimex-lpc1766stk/ostest/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/olimex-lpc1766stk/slip-httpd/Make.defs b/configs/olimex-lpc1766stk/slip-httpd/Make.defs
index 7f7278d06d..984d4e1874 100644
--- a/configs/olimex-lpc1766stk/slip-httpd/Make.defs
+++ b/configs/olimex-lpc1766stk/slip-httpd/Make.defs
@@ -120,7 +120,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/olimex-lpc1766stk/thttpd/Make.defs b/configs/olimex-lpc1766stk/thttpd/Make.defs
index 96270bc288..11e155ed89 100644
--- a/configs/olimex-lpc1766stk/thttpd/Make.defs
+++ b/configs/olimex-lpc1766stk/thttpd/Make.defs
@@ -120,7 +120,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/olimex-lpc1766stk/usbserial/Make.defs b/configs/olimex-lpc1766stk/usbserial/Make.defs
index 2d7321efde..1cedb01d72 100644
--- a/configs/olimex-lpc1766stk/usbserial/Make.defs
+++ b/configs/olimex-lpc1766stk/usbserial/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/olimex-lpc1766stk/usbstorage/Make.defs b/configs/olimex-lpc1766stk/usbstorage/Make.defs
index 8c62990aeb..f879340f14 100644
--- a/configs/olimex-lpc1766stk/usbstorage/Make.defs
+++ b/configs/olimex-lpc1766stk/usbstorage/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/olimex-lpc1766stk/wlan/Make.defs b/configs/olimex-lpc1766stk/wlan/Make.defs
index 593d5f9391..a316a0e6a6 100644
--- a/configs/olimex-lpc1766stk/wlan/Make.defs
+++ b/configs/olimex-lpc1766stk/wlan/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/olimex-lpc2378/nsh/Make.defs b/configs/olimex-lpc2378/nsh/Make.defs
index 2821aa73c2..022f3670b7 100644
--- a/configs/olimex-lpc2378/nsh/Make.defs
+++ b/configs/olimex-lpc2378/nsh/Make.defs
@@ -129,7 +129,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/olimex-lpc2378/ostest/Make.defs b/configs/olimex-lpc2378/ostest/Make.defs
index 69be8db5b1..043f7ad8e9 100644
--- a/configs/olimex-lpc2378/ostest/Make.defs
+++ b/configs/olimex-lpc2378/ostest/Make.defs
@@ -129,7 +129,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/olimex-stm32-p107/nsh/Make.defs b/configs/olimex-stm32-p107/nsh/Make.defs
index 5175c2f8f6..3314a82bef 100644
--- a/configs/olimex-stm32-p107/nsh/Make.defs
+++ b/configs/olimex-stm32-p107/nsh/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/olimex-stm32-p107/ostest/Make.defs b/configs/olimex-stm32-p107/ostest/Make.defs
index 28c9ab8138..fdceac03ba 100644
--- a/configs/olimex-stm32-p107/ostest/Make.defs
+++ b/configs/olimex-stm32-p107/ostest/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/olimex-strp711/nettest/Make.defs b/configs/olimex-strp711/nettest/Make.defs
index e4b8a9852c..1c751be09d 100644
--- a/configs/olimex-strp711/nettest/Make.defs
+++ b/configs/olimex-strp711/nettest/Make.defs
@@ -110,7 +110,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/olimex-strp711/nsh/Make.defs b/configs/olimex-strp711/nsh/Make.defs
index 9ef265d0e1..d2c674d3a5 100644
--- a/configs/olimex-strp711/nsh/Make.defs
+++ b/configs/olimex-strp711/nsh/Make.defs
@@ -110,7 +110,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/olimex-strp711/ostest/Make.defs b/configs/olimex-strp711/ostest/Make.defs
index f4bb09d991..37adf602a4 100644
--- a/configs/olimex-strp711/ostest/Make.defs
+++ b/configs/olimex-strp711/ostest/Make.defs
@@ -110,7 +110,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \
- -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \
+ -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \
-no-check-sections
LDNXFLATFLAGS = -e main -s 2048
diff --git a/configs/pcblogic-pic32mx/nsh/Make.defs b/configs/pcblogic-pic32mx/nsh/Make.defs
index ecc50dc29d..9608ce0ee4 100644
--- a/configs/pcblogic-pic32mx/nsh/Make.defs
+++ b/configs/pcblogic-pic32mx/nsh/Make.defs
@@ -118,7 +118,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/pcblogic-pic32mx/ostest/Make.defs b/configs/pcblogic-pic32mx/ostest/Make.defs
index 31be1dc8d6..0376ee339f 100644
--- a/configs/pcblogic-pic32mx/ostest/Make.defs
+++ b/configs/pcblogic-pic32mx/ostest/Make.defs
@@ -118,7 +118,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/pic32-starterkit/nsh/Make.defs b/configs/pic32-starterkit/nsh/Make.defs
index 9f8762bf78..962801567f 100644
--- a/configs/pic32-starterkit/nsh/Make.defs
+++ b/configs/pic32-starterkit/nsh/Make.defs
@@ -118,7 +118,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/pic32-starterkit/nsh2/Make.defs b/configs/pic32-starterkit/nsh2/Make.defs
index 08be39d396..2068db849d 100644
--- a/configs/pic32-starterkit/nsh2/Make.defs
+++ b/configs/pic32-starterkit/nsh2/Make.defs
@@ -118,7 +118,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/pic32-starterkit/ostest/Make.defs b/configs/pic32-starterkit/ostest/Make.defs
index d00518b98f..370ac7f1fb 100644
--- a/configs/pic32-starterkit/ostest/Make.defs
+++ b/configs/pic32-starterkit/ostest/Make.defs
@@ -118,7 +118,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/pic32mx7mmb/nsh/Make.defs b/configs/pic32mx7mmb/nsh/Make.defs
index 608a31442a..ed776bc191 100644
--- a/configs/pic32mx7mmb/nsh/Make.defs
+++ b/configs/pic32mx7mmb/nsh/Make.defs
@@ -118,7 +118,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/pic32mx7mmb/ostest/Make.defs b/configs/pic32mx7mmb/ostest/Make.defs
index a203f30e9f..54806fb95a 100644
--- a/configs/pic32mx7mmb/ostest/Make.defs
+++ b/configs/pic32mx7mmb/ostest/Make.defs
@@ -118,7 +118,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/sam3u-ek/README.txt b/configs/sam3u-ek/README.txt
index b13c689457..91f8824098 100644
--- a/configs/sam3u-ek/README.txt
+++ b/configs/sam3u-ek/README.txt
@@ -172,12 +172,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
^^^^^^^^^^^^^^^^
diff --git a/configs/sam3u-ek/knsh/Make.defs b/configs/sam3u-ek/knsh/Make.defs
index f65420bcf0..a402a4d512 100644
--- a/configs/sam3u-ek/knsh/Make.defs
+++ b/configs/sam3u-ek/knsh/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/sam3u-ek/nsh/Make.defs b/configs/sam3u-ek/nsh/Make.defs
index c73b1f785a..5bf989aad8 100644
--- a/configs/sam3u-ek/nsh/Make.defs
+++ b/configs/sam3u-ek/nsh/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/sam3u-ek/nx/Make.defs b/configs/sam3u-ek/nx/Make.defs
index 31b4407818..e4140a1103 100644
--- a/configs/sam3u-ek/nx/Make.defs
+++ b/configs/sam3u-ek/nx/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/sam3u-ek/ostest/Make.defs b/configs/sam3u-ek/ostest/Make.defs
index 9fcea29f61..8c765976b1 100644
--- a/configs/sam3u-ek/ostest/Make.defs
+++ b/configs/sam3u-ek/ostest/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/sam3u-ek/touchscreen/Make.defs b/configs/sam3u-ek/touchscreen/Make.defs
index fb8ab9358a..99410a652c 100644
--- a/configs/sam3u-ek/touchscreen/Make.defs
+++ b/configs/sam3u-ek/touchscreen/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/shenzhou/README.txt b/configs/shenzhou/README.txt
index c04c55ad02..ff4cf74508 100644
--- a/configs/shenzhou/README.txt
+++ b/configs/shenzhou/README.txt
@@ -40,7 +40,9 @@ Contents
- Development Environment
- GNU Toolchain Options
- IDEs
- - NuttX buildroot Toolchain
+ - NuttX EABI buildroot Toolchain
+ - NuttX OABI buildroot Toolchain
+ - NXFLAT Toolchain
- Shenzhou-specific Configuration Options
- LEDs
- Shenzhou-specific Configuration Options
@@ -330,8 +332,8 @@ IDEs
one time from the Cygwin command line in order to obtain the pre-built
startup object needed by RIDE.
-NuttX buildroot Toolchain
-=========================
+NuttX EABI buildroot Toolchain
+==============================
A GNU GCC-based toolchain is assumed. The files */setenv.sh should
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
@@ -382,6 +384,58 @@ NuttX buildroot Toolchain
detailed PLUS some special instructions that you will need to follow if you are
building a Cortex-M3 toolchain for Cygwin under Windows.
+NuttX OABI "buildroot" Toolchain
+================================
+
+ The older, OABI buildroot toolchain is also available. To use the OABI
+ toolchain:
+
+ 1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
+ configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
+ configuration such as cortexm3-defconfig-4.3.3
+
+ 2. Modify the Make.defs file to use the OABI conventions:
+
+ +CROSSDEV = arm-nuttx-elf-
+ +ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
+ -CROSSDEV = arm-nuttx-eabi-
+ -ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
+
+NXFLAT Toolchain
+================
+
+ If you are *not* using the NuttX buildroot toolchain and you want to use
+ the NXFLAT tools, then you will still have to build a portion of the buildroot
+ tools -- just the NXFLAT tools. The buildroot with the NXFLAT tools can
+ be downloaded from the NuttX SourceForge download site
+ (https://sourceforge.net/projects/nuttx/files/).
+
+ This GNU toolchain builds and executes in the Linux or Cygwin environment.
+
+ 1. You must have already configured Nuttx in /nuttx.
+
+ cd tools
+ ./configure.sh lpcxpresso-lpc1768/
+
+ 2. Download the latest buildroot package into
+
+ 3. unpack the buildroot tarball. The resulting directory may
+ have versioning information on it like buildroot-x.y.z. If so,
+ rename /buildroot-x.y.z to /buildroot.
+
+ 4. cd /buildroot
+
+ 5. cp configs/cortexm3-defconfig-nxflat .config
+
+ 6. make oldconfig
+
+ 7. make
+
+ 8. Edit setenv.h, if necessary, so that the PATH variable includes
+ the path to the newly builtNXFLAT binaries.
+
LEDs
====
diff --git a/configs/shenzhou/nsh/Make.defs b/configs/shenzhou/nsh/Make.defs
index 588bb27600..2318e6c9cb 100644
--- a/configs/shenzhou/nsh/Make.defs
+++ b/configs/shenzhou/nsh/Make.defs
@@ -151,7 +151,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/shenzhou/nxwm/Make.defs b/configs/shenzhou/nxwm/Make.defs
index d94f0c38a1..84e0df782d 100644
--- a/configs/shenzhou/nxwm/Make.defs
+++ b/configs/shenzhou/nxwm/Make.defs
@@ -151,7 +151,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3210e-eval/README.txt b/configs/stm3210e-eval/README.txt
index 704fadb62c..65f511320a 100644
--- a/configs/stm3210e-eval/README.txt
+++ b/configs/stm3210e-eval/README.txt
@@ -180,12 +180,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
================
diff --git a/configs/stm3210e-eval/RIDE/Make.defs b/configs/stm3210e-eval/RIDE/Make.defs
index 30dfda704b..6e69590c7a 100644
--- a/configs/stm3210e-eval/RIDE/Make.defs
+++ b/configs/stm3210e-eval/RIDE/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3210e-eval/buttons/Make.defs b/configs/stm3210e-eval/buttons/Make.defs
index f18619f80c..860d81c1fb 100644
--- a/configs/stm3210e-eval/buttons/Make.defs
+++ b/configs/stm3210e-eval/buttons/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3210e-eval/composite/Make.defs b/configs/stm3210e-eval/composite/Make.defs
index 8486635736..c0d85bf227 100644
--- a/configs/stm3210e-eval/composite/Make.defs
+++ b/configs/stm3210e-eval/composite/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3210e-eval/nsh/Make.defs b/configs/stm3210e-eval/nsh/Make.defs
index e3e4888fed..03d19fbc80 100644
--- a/configs/stm3210e-eval/nsh/Make.defs
+++ b/configs/stm3210e-eval/nsh/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3210e-eval/nsh2/Make.defs b/configs/stm3210e-eval/nsh2/Make.defs
index 3305166962..f84c115529 100644
--- a/configs/stm3210e-eval/nsh2/Make.defs
+++ b/configs/stm3210e-eval/nsh2/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3210e-eval/nx/Make.defs b/configs/stm3210e-eval/nx/Make.defs
index 6aaa6644be..7f253873a1 100644
--- a/configs/stm3210e-eval/nx/Make.defs
+++ b/configs/stm3210e-eval/nx/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3210e-eval/nxconsole/Make.defs b/configs/stm3210e-eval/nxconsole/Make.defs
index 7b2be02a51..8993a53aab 100644
--- a/configs/stm3210e-eval/nxconsole/Make.defs
+++ b/configs/stm3210e-eval/nxconsole/Make.defs
@@ -131,7 +131,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3210e-eval/nxlines/Make.defs b/configs/stm3210e-eval/nxlines/Make.defs
index 1469658a0e..190ed098f8 100644
--- a/configs/stm3210e-eval/nxlines/Make.defs
+++ b/configs/stm3210e-eval/nxlines/Make.defs
@@ -131,7 +131,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3210e-eval/nxtext/Make.defs b/configs/stm3210e-eval/nxtext/Make.defs
index b130e56225..d4f8ec2fe3 100644
--- a/configs/stm3210e-eval/nxtext/Make.defs
+++ b/configs/stm3210e-eval/nxtext/Make.defs
@@ -131,7 +131,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3210e-eval/ostest/Make.defs b/configs/stm3210e-eval/ostest/Make.defs
index bd50d3b69d..ef1a3d4234 100644
--- a/configs/stm3210e-eval/ostest/Make.defs
+++ b/configs/stm3210e-eval/ostest/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3210e-eval/pm/Make.defs b/configs/stm3210e-eval/pm/Make.defs
index 6ad7e3a4ca..a60e4a7745 100644
--- a/configs/stm3210e-eval/pm/Make.defs
+++ b/configs/stm3210e-eval/pm/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3210e-eval/usbserial/Make.defs b/configs/stm3210e-eval/usbserial/Make.defs
index 586c361a92..f08d5b68c4 100644
--- a/configs/stm3210e-eval/usbserial/Make.defs
+++ b/configs/stm3210e-eval/usbserial/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3210e-eval/usbstorage/Make.defs b/configs/stm3210e-eval/usbstorage/Make.defs
index c305b42c9f..7f2cb73b66 100644
--- a/configs/stm3210e-eval/usbstorage/Make.defs
+++ b/configs/stm3210e-eval/usbstorage/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3220g-eval/README.txt b/configs/stm3220g-eval/README.txt
index 79311150d3..36fd75d256 100644
--- a/configs/stm3220g-eval/README.txt
+++ b/configs/stm3220g-eval/README.txt
@@ -219,12 +219,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
================
diff --git a/configs/stm3220g-eval/dhcpd/Make.defs b/configs/stm3220g-eval/dhcpd/Make.defs
index 3f2c4e0661..e8bb28c762 100644
--- a/configs/stm3220g-eval/dhcpd/Make.defs
+++ b/configs/stm3220g-eval/dhcpd/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3220g-eval/nettest/Make.defs b/configs/stm3220g-eval/nettest/Make.defs
index c6b2f895b1..2c6b8a1f4e 100644
--- a/configs/stm3220g-eval/nettest/Make.defs
+++ b/configs/stm3220g-eval/nettest/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3220g-eval/nsh/Make.defs b/configs/stm3220g-eval/nsh/Make.defs
index 3bd7c15283..834db56bca 100644
--- a/configs/stm3220g-eval/nsh/Make.defs
+++ b/configs/stm3220g-eval/nsh/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3220g-eval/nsh2/Make.defs b/configs/stm3220g-eval/nsh2/Make.defs
index dfd41d5c53..f29c472148 100644
--- a/configs/stm3220g-eval/nsh2/Make.defs
+++ b/configs/stm3220g-eval/nsh2/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3220g-eval/nxwm/Make.defs b/configs/stm3220g-eval/nxwm/Make.defs
index 65442d7312..4b770ba64e 100644
--- a/configs/stm3220g-eval/nxwm/Make.defs
+++ b/configs/stm3220g-eval/nxwm/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3220g-eval/ostest/Make.defs b/configs/stm3220g-eval/ostest/Make.defs
index 270d533394..a67036f78a 100644
--- a/configs/stm3220g-eval/ostest/Make.defs
+++ b/configs/stm3220g-eval/ostest/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3220g-eval/telnetd/Make.defs b/configs/stm3220g-eval/telnetd/Make.defs
index 0d7f1a078f..4a69279062 100644
--- a/configs/stm3220g-eval/telnetd/Make.defs
+++ b/configs/stm3220g-eval/telnetd/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3240g-eval/README.txt b/configs/stm3240g-eval/README.txt
index d77609e126..6da18b7e50 100644
--- a/configs/stm3240g-eval/README.txt
+++ b/configs/stm3240g-eval/README.txt
@@ -226,12 +226,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
================
diff --git a/configs/stm3240g-eval/dhcpd/Make.defs b/configs/stm3240g-eval/dhcpd/Make.defs
index e84648b105..5b1334a073 100644
--- a/configs/stm3240g-eval/dhcpd/Make.defs
+++ b/configs/stm3240g-eval/dhcpd/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3240g-eval/discover/Make.defs b/configs/stm3240g-eval/discover/Make.defs
index 561bed1e0c..58afd39038 100644
--- a/configs/stm3240g-eval/discover/Make.defs
+++ b/configs/stm3240g-eval/discover/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3240g-eval/nettest/Make.defs b/configs/stm3240g-eval/nettest/Make.defs
index 71764aa24a..a7e4f9e077 100644
--- a/configs/stm3240g-eval/nettest/Make.defs
+++ b/configs/stm3240g-eval/nettest/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3240g-eval/nsh/Make.defs b/configs/stm3240g-eval/nsh/Make.defs
index 71da0724ab..d63876e754 100644
--- a/configs/stm3240g-eval/nsh/Make.defs
+++ b/configs/stm3240g-eval/nsh/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3240g-eval/nsh2/Make.defs b/configs/stm3240g-eval/nsh2/Make.defs
index 51aaf553ec..16fef33447 100644
--- a/configs/stm3240g-eval/nsh2/Make.defs
+++ b/configs/stm3240g-eval/nsh2/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3240g-eval/nxconsole/Make.defs b/configs/stm3240g-eval/nxconsole/Make.defs
index 34865b5c28..20fabfc9d2 100644
--- a/configs/stm3240g-eval/nxconsole/Make.defs
+++ b/configs/stm3240g-eval/nxconsole/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3240g-eval/nxwm/Make.defs b/configs/stm3240g-eval/nxwm/Make.defs
index b15333c96f..bf2da32464 100644
--- a/configs/stm3240g-eval/nxwm/Make.defs
+++ b/configs/stm3240g-eval/nxwm/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3240g-eval/ostest/Make.defs b/configs/stm3240g-eval/ostest/Make.defs
index 768a095f8e..c984a7e85c 100644
--- a/configs/stm3240g-eval/ostest/Make.defs
+++ b/configs/stm3240g-eval/ostest/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3240g-eval/telnetd/Make.defs b/configs/stm3240g-eval/telnetd/Make.defs
index 8255e07674..498ee33861 100644
--- a/configs/stm3240g-eval/telnetd/Make.defs
+++ b/configs/stm3240g-eval/telnetd/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3240g-eval/webserver/Make.defs b/configs/stm3240g-eval/webserver/Make.defs
index 855ca4186e..fb47d40050 100644
--- a/configs/stm3240g-eval/webserver/Make.defs
+++ b/configs/stm3240g-eval/webserver/Make.defs
@@ -152,7 +152,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm3240g-eval/xmlrpc/Make.defs b/configs/stm3240g-eval/xmlrpc/Make.defs
index dab94db502..8f7fe96dc1 100644
--- a/configs/stm3240g-eval/xmlrpc/Make.defs
+++ b/configs/stm3240g-eval/xmlrpc/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm32f4discovery/README.txt b/configs/stm32f4discovery/README.txt
index 65b4bf7527..2054e90c63 100644
--- a/configs/stm32f4discovery/README.txt
+++ b/configs/stm32f4discovery/README.txt
@@ -223,12 +223,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
================
diff --git a/configs/stm32f4discovery/nsh/Make.defs b/configs/stm32f4discovery/nsh/Make.defs
index bab095abcc..ed1662af5d 100644
--- a/configs/stm32f4discovery/nsh/Make.defs
+++ b/configs/stm32f4discovery/nsh/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm32f4discovery/nxlines/Make.defs b/configs/stm32f4discovery/nxlines/Make.defs
index 042da6a928..cfdb79a74a 100644
--- a/configs/stm32f4discovery/nxlines/Make.defs
+++ b/configs/stm32f4discovery/nxlines/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm32f4discovery/ostest/Make.defs b/configs/stm32f4discovery/ostest/Make.defs
index 10025ad9d7..6ed8530ad2 100644
--- a/configs/stm32f4discovery/ostest/Make.defs
+++ b/configs/stm32f4discovery/ostest/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/stm32f4discovery/pm/Make.defs b/configs/stm32f4discovery/pm/Make.defs
index 1a67f1b8c4..3643548d47 100644
--- a/configs/stm32f4discovery/pm/Make.defs
+++ b/configs/stm32f4discovery/pm/Make.defs
@@ -153,7 +153,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/sure-pic32mx/nsh/Make.defs b/configs/sure-pic32mx/nsh/Make.defs
index ac6df4056e..debf622d28 100644
--- a/configs/sure-pic32mx/nsh/Make.defs
+++ b/configs/sure-pic32mx/nsh/Make.defs
@@ -118,7 +118,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/sure-pic32mx/ostest/Make.defs b/configs/sure-pic32mx/ostest/Make.defs
index ac93ceeb00..0c8d4346a5 100644
--- a/configs/sure-pic32mx/ostest/Make.defs
+++ b/configs/sure-pic32mx/ostest/Make.defs
@@ -118,7 +118,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/sure-pic32mx/usbnsh/Make.defs b/configs/sure-pic32mx/usbnsh/Make.defs
index 8faadcf961..fa8d3700fa 100644
--- a/configs/sure-pic32mx/usbnsh/Make.defs
+++ b/configs/sure-pic32mx/usbnsh/Make.defs
@@ -118,7 +118,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/teensy/hello/Make.defs b/configs/teensy/hello/Make.defs
index cca88363cd..b79a52ed91 100644
--- a/configs/teensy/hello/Make.defs
+++ b/configs/teensy/hello/Make.defs
@@ -107,7 +107,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/teensy/nsh/Make.defs b/configs/teensy/nsh/Make.defs
index 13f8e79027..65838649cb 100644
--- a/configs/teensy/nsh/Make.defs
+++ b/configs/teensy/nsh/Make.defs
@@ -107,7 +107,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/teensy/usbstorage/Make.defs b/configs/teensy/usbstorage/Make.defs
index 706daf81f6..fa2997fb06 100644
--- a/configs/teensy/usbstorage/Make.defs
+++ b/configs/teensy/usbstorage/Make.defs
@@ -107,7 +107,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/twr-k60n512/README.txt b/configs/twr-k60n512/README.txt
index 3ac70cf7eb..27644deaef 100644
--- a/configs/twr-k60n512/README.txt
+++ b/configs/twr-k60n512/README.txt
@@ -437,12 +437,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
================
diff --git a/configs/twr-k60n512/nsh/Make.defs b/configs/twr-k60n512/nsh/Make.defs
index 7bb9f09d4a..f2922c575b 100644
--- a/configs/twr-k60n512/nsh/Make.defs
+++ b/configs/twr-k60n512/nsh/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/twr-k60n512/ostest/Make.defs b/configs/twr-k60n512/ostest/Make.defs
index 9254223dca..871141640d 100644
--- a/configs/twr-k60n512/ostest/Make.defs
+++ b/configs/twr-k60n512/ostest/Make.defs
@@ -117,7 +117,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/ubw32/nsh/Make.defs b/configs/ubw32/nsh/Make.defs
index ca73b9defd..07a966446f 100644
--- a/configs/ubw32/nsh/Make.defs
+++ b/configs/ubw32/nsh/Make.defs
@@ -118,7 +118,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/ubw32/ostest/Make.defs b/configs/ubw32/ostest/Make.defs
index 739d78075e..4f2971768d 100644
--- a/configs/ubw32/ostest/Make.defs
+++ b/configs/ubw32/ostest/Make.defs
@@ -118,7 +118,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/configs/vsn/README.txt b/configs/vsn/README.txt
index b05ffa5dde..ae5f374ddd 100644
--- a/configs/vsn/README.txt
+++ b/configs/vsn/README.txt
@@ -177,12 +177,14 @@ NuttX OABI "buildroot" Toolchain
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
configuration such as cortexm3-defconfig-4.3.3
- 2. Modify the Make.defs file to use the OABI converntions:
+ 2. Modify the Make.defs file to use the OABI conventions:
+CROSSDEV = arm-nuttx-elf-
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
+ +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
-CROSSDEV = arm-nuttx-eabi-
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
+ -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
NXFLAT Toolchain
^^^^^^^^^^^^^^^^
diff --git a/configs/vsn/nsh/Make.defs b/configs/vsn/nsh/Make.defs
index 292abcc726..64b972ee27 100644
--- a/configs/vsn/nsh/Make.defs
+++ b/configs/vsn/nsh/Make.defs
@@ -129,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o