diff --git a/Documentation/NuttXNxFlat.html b/Documentation/NuttXNxFlat.html index 73be5d7b34..4d70ed9c37 100644 --- a/Documentation/NuttXNxFlat.html +++ b/Documentation/NuttXNxFlat.html @@ -229,13 +229,16 @@
  • Read-Only Data in RAM
  • Globally Scoped Function Function Pointers @@ -464,7 +467,7 @@ cat ../syscall/syscall.csv ../lib/lib.csv | sort >tmp.csv

    - abc-nuttx-elf-ld -r -d -warn-common -T binfmt/libnxflat/gnu-nxflat.ld -no-check-sections -o $@ hello.o hello-thunk.o + abc-nuttx-elf-ld -r -d -warn-common -T binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections -o $@ hello.o hello-thunk.o @@ -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. +

    +
      +
    1. + 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. +
    2. +
    3. + 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. +
    4. +
    +

    Target 4. Finally, this target will use the hello.r2 relocatable object to create the final, NXFLAT module hello by executing ldnxflat.