195 Commits

Author SHA1 Message Date
Chris Johns
fdb1fe685a linkers: Add base image symbol to ELF object file generation.
This change adds support to the rtems-syms code to generate a suitable
ELF object you can link to the base image kernel in the embed mode or
you can load with the run-time load mode.

The change fixes a bug in the framework where local ELF symbols
were being placed in the external symbol table. The external
symbol table has been removed and a global, weak and local set
of tables is now provided as this is more aligned with the ELF
format.
2014-10-30 17:55:18 +11:00
Chris Johns
aac294948c linkers: Add kernel symbol support.
The rtems-sym tool has been changed from a basic map tool to now
provide an object file in the specific architecture containing
the symbols in the RTEMS kernel. It can still generate a map.

The object can be embedded or loaded. It cannot be both.
2014-10-28 01:14:02 -07:00
Chris Johns
6ae559c96b rtems-tld: Make printk the default generator. 2014-09-22 08:23:39 +10:00
Chris Johns
5025439f9d rtems-tld: Add config options, fix void args, and SCore traces. 2014-09-21 14:24:37 +10:00
Chris Johns
149a8a6361 rtems-tld: Remove forced trace message. 2014-09-21 08:50:56 +10:00
Chris Johns
435d879bb6 rtk: Build fastlz into the rld library.
Do not build as an object per program.
2014-09-13 12:26:45 +10:00
Chris Johns
87e0e76be5 Refactor code into the RTEMS Toolkit. 2014-09-13 12:09:16 +10:00
Chris Johns
749ddf1ed5 waf: Include waf in the souce tree and updated README on building.
Add support to build all parts of The RTEMS Tools project.
2014-09-13 10:47:07 +10:00
Chris Johns
e0b8975853 Remove invalid file that was added. 2014-09-13 08:48:17 +10:00
Chris Johns
7168ab3da5 rtems-tld: Add a printk generator. 2014-09-10 13:10:45 +10:00
Chris Johns
5afb2b8d5b rtems-tld: Fix warnings in the generated code. 2014-09-10 13:10:20 +10:00
Chris Johns
2d5de2e120 Fix the error message. 2014-09-10 11:16:26 +10:00
Chris Johns
67369b148b Fix the tempfile output code to handle line breaks better. 2014-09-10 11:15:29 +10:00
Chris Johns
30a7f069e7 Make the verbose take the level and return the level if valid.
This makes the verbose a single and removes the need to have the
logic of the test in the code.
2014-09-10 11:14:06 +10:00
Chris Johns
b7ad4a2431 linkers: If no RTEMS path is provied see if the prefix can be used. 2014-09-09 08:40:13 +10:00
Chris Johns
6fb1409215 rtems-tld: Add entry and exit trace support. 2014-09-09 08:20:41 +10:00
Chris Johns
2126ea7ff0 rtems-tld: Generate arg and ret code in the wrapper. 2014-09-08 19:29:41 +10:00
Chris Johns
17c836402f Fix building on CentOS 6.5. 2014-09-08 16:37:32 +10:00
Chris Johns
6506aa14aa RTEMS trace linker builds trace applications.
The trace linker builds the both_hello example in examples-v2.

Move the various string support functions into a C++ file and stop being
inlined. Make them return const std::string.

Add ld support to rld-cc.

Add search path support to rld-config so installed common files can be used.

Fix the path bugs.

Add an absolute path function to rld-path.
2014-09-08 16:06:48 +10:00
Chris Johns
b28e8b3115 Refactor the rld-rtems support to remove the globals. 2014-09-07 14:31:18 +10:00
Chris Johns
32cd4fcc17 rtems-tld: Add --wrapper option to aid testing.
The --wrapper option lets a user control the wrapper file name and
location to aid testing.

Add keep support to tempfiles so specific tempfile can be set
to be kept.

Add unlink to the rld::path namespace.
2014-09-07 10:47:00 +10:00
Chris Johns
3f5e31f86d Chanhe the base temp file name to 'rld--'. 2014-09-07 10:45:36 +10:00
Chris Johns
c4c8218373 Fix rtems-ld to keep tmep files around while building. 2014-09-06 21:59:25 +10:00
Chris Johns
8807135964 Refactor the CC flags. Fix the various linkers. The trace linker is compiling. 2014-09-06 20:19:45 +10:00
Chris Johns
a916fa4230 Fxi the split call. 2014-09-06 20:19:08 +10:00
Chris Johns
a72a9e357d Add a path str. Remove the duplicate split call. 2014-09-06 20:17:56 +10:00
Chris Johns
b233be7a3f Trim the return value from a package file. 2014-09-06 20:15:48 +10:00
Chris Johns
31bf37564b Remove march/mcpu and add RTEMS BSP and cflags support. 2014-09-05 18:18:11 +10:00
Chris Johns
7ccb670158 Add support for RTEMS BSP or user supplied CFLAGS. Remove march/mcpu.
Added support to read an RTEMS BSP pkgconfig file and ste the CC
flags.
2014-09-05 18:16:40 +10:00
Chris Johns
2f48445837 Return the requested label.
This completes this code to a basic working level. It usable for the
RTEMS pc files but not as a full pkgconfig replacement. The python
version in the RSB is more complete.
2014-09-05 18:10:46 +10:00
Chris Johns
40fd7a088a rld: Split the file into a path module for path specific functions.
This allows resued for other parts of the system not dependent on
objcet files or archives.
2014-09-01 13:26:47 +10:00
Peng Fan
e5165d2d0a Fix getopt_long usage
When passing shorhand options, getopt_long sometimes does not handle
them correctly.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
2014-09-01 09:59:01 +10:00
Chris Johns
097f1fdf56 rtms-tld: Refactor the code to match a better configuration format. 2014-08-07 18:15:06 +10:00
Chris Johns
4fd758e4f6 rtems-tld: Add wrapper support and start the generator coding. 2014-08-05 23:02:35 +10:00
Chris Johns
a136346d14 Fix temporary file handling and add tempfile write support.
Move the static objects into the rld-process file and change the
clean up to a call.

Add support to write to tempfiles.
2014-08-05 23:01:15 +10:00
Chris Johns
058d5024e9 rtems-tld: Add generator loading support. 2014-08-04 15:09:39 +10:00
Chris Johns
0a2102442e rtems-tld: Add recursive parsing of headers and defines. 2014-08-04 09:50:56 +10:00
Chris Johns
b6d7f5ff2e rtems-tld: Add trace configuration support.
Extend the configuration support to provide the needed configuration
required to generate the C stub support.
2014-08-04 09:19:55 +10:00
Chris Johns
ea299027e8 Add initial support for the RTEM Trace Linker.
The RTEMS Trace Linker or rtems-rld creates an RTEMS executable with
trace support built in without any changes the existing code.

This commit is an initial starting point with function signatures
being read from INI files.
2014-08-01 16:48:09 +10:00
Chris Johns
2ce23a3d6f Fix building on Windows with the latest MSVC.
Remove some warnings.
2014-08-01 16:47:11 +10:00
Peng Fan
427acf320c std::list should be sorted before unique
std::list should be sorted first, then unique can remove duplicated
objects. Otherwise there will be many duplicated objects.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
2014-07-24 17:15:42 +10:00
Peng Fan
53ed116b90 Implement a new tool 'rtems-ra'
rtems-ra supports converting an elf archive file into a rap archive file.
It also support add, replace and delete rap files from the rap archive
file.
2013-08-30 21:42:58 +08:00
Peng Fan
64309e0b78 Ignore common section and null(index 0) section
Signed-off-by: Peng Fan <van.freenix@gmail.com>
2013-08-29 19:42:33 +08:00
Peng Fan
37a7a7c92f RA format support for rtems-ld
1. Automatically place object files in archive files into a ra file,
   using new option --runtime-lib
2. Add a new option --one-file to decide whether the collected
   object files should be merged into the rap file or not.

Signed-off-by: Peng Fan <van.freenix@gmail.com>
2013-08-29 19:41:49 +08:00
Peng Fan
5eb6604773 Fix archive writer
1. align to even address
2. Fix the use of GElf_Ehdr and Elf32_Ehdr
3. Fix the header related
2013-08-29 19:41:23 +08:00
Peng Fan
59c3ebd7f4 Add rpath support 2013-08-04 22:35:42 +08:00
Peng Fan
347c9b585e Add section size for rap details
Add elf section size to the section details, because gdb will use the size of
a section.
2013-08-01 16:15:07 +08:00
Peng Fan
39f48c9047 Add object file details to RAP format
This change added the object file details to the RAP format so aid debugging
support. The information can be optionally stripped for production images
not needed this information if space is an issue,with '--rap-strip' assigned
to rtems-ld.
2013-07-26 17:45:01 +08:00
Peng Fan
76d3b8962c collect 'STT_NOTYPE' symbols 2013-07-22 09:44:15 +08:00
Peng Fan
f2915943d1 fix relocation records order 2013-07-22 00:39:21 +08:00