From 345e9ec8d7b7bf5a95db48bf03bf65cbdd84f141 Mon Sep 17 00:00:00 2001
From: patacongo Last Updated: August 12, 2010 Last Updated: June 29, 2012 Last Updated: September 1, 2012
+ There is a small helper program available in
+ For example,
+
Below is a snippet from an NXFLAT make file (simplified from NuttX
@@ -639,8 +678,7 @@ any following arguments.
diff --git a/Documentation/NuttXNxFlat.html b/Documentation/NuttXNxFlat.html
index e6923a8bcb..8fab8fed16 100644
--- a/Documentation/NuttXNxFlat.html
+++ b/Documentation/NuttXNxFlat.html
@@ -9,8 +9,7 @@
On-Demand Paging
- >>> Under Construction <<<
@@ -90,7 +89,13 @@
NXFLAT
- >>> Under Construction <<<
-
+
- 1.4 Making an NXFLAT module
+ 1.4 mksymtab
+
+
+
+
+ 1.5 Making an NXFLAT module
@@ -122,7 +127,7 @@
-f
+
1.0 Overview
1.1 Functionality
@@ -386,7 +391,41 @@ any following arguments.
debug output is enabled [Default: no verbose output].
-1.4 Making an NXFLAT module
+1.4 mksymtab
+
+nuttx/tools
call mksymtab
.
+ mksymtab
can be sued to generate symbol tables for the NuttX base code that would be usable by the typical NXFLAT application.
+ mksymtab
builds symbol tables from common-separated value (CSV) files.
+ In particular, the CSV files:
+
+
+nuttx/syscall/syscall.csv
that describes the NuttX RTOS interface, and
+ nuttx/lib/lib/csv
that describes the NuttX C library interface.
+
+USAGE: ./mksymtab <cvs-file> <symtab-file>
+
+Where:
+
+ <cvs-file> : The path to the input CSV file
+ <symtab-file>: The path to the output symbol table file
+ -d : Enable debug output
+
+
+cd nuttx/tools
+cat ../syscall/syscall.csv ../lib/lib.csv | sort >tmp.csv
+./mksymtab.exe tmp.csv tmp.c
+
+
+1.5 Making an NXFLAT module
ldr r1, .L0 <-- Fetch the offset to 'x'
- ldr r0, [r10, r1] <-- Load the value of 'x' with PIC
- offset
+ ldr r0, [r10, r1] <-- Load the value of 'x' with PIC offset`
...
.L0: .word x <-- Offset to 'x'
@@ -652,8 +690,7 @@ any following arguments.
ldr r1, .L0 <-- Fetch the offset to the GOT entry
- ldr r1, [r10,r1] <-- Fetch the (relocated) address
- of 'x' from the GOT
+ ldr r1, [r10,r1] <-- Fetch the (relocated) address of 'x' from the GOT
ldr r0, [r1, #0] <-- Fetch the value of 'x'
...
.L1 .word x(GOT) <-- Offset to entry in the GOT
@@ -667,9 +704,9 @@ any following arguments.
execution time.
- NXFLAT (like XFLAT) can work even better with + NXFLAT (like XFLAT) can work even better without the GOT. - Patches again older version of GCC exist to eliminate the GOT indirections. + Patches against older version of GCC exist to eliminate the GOT indirections. Several are available here if you are inspired to port them to a new GCC version.
@@ -735,7 +772,7 @@ any following arguments. XFLAT discussion.- Patches again older version of GCC exist to correct this GCC behavior. + Patches against older version of GCC exist to correct this GCC behavior. Several are available here if you are inspired to port them to a new GCC version.