31 Commits

Author SHA1 Message Date
Sebastian Huber
cfef4b11dd linkers: Allow generation of symbol map file only
If a symbol map file is specified by the user and no output file, then
just generate the symbol map file.  The user can then compile the file
using its own build jobs.
2024-02-29 09:56:32 +01:00
Sebastian Huber
99eb2972a4 linkers: Constify read-only data 2024-02-29 09:56:32 +01:00
Sebastian Huber
19ba98bdd9 linkers: Avoid void pointer arithmetic 2024-02-29 09:56:32 +01:00
Sebastian Huber
8e77e113ba linkers: Use push/pop section
Restore the previous section, otherwise the generated code may end up in
a wrong section.
2024-01-25 08:15:12 +01:00
Sebastian Huber
af2b1532e8 linkers: Print a proper 0x-hex number
It is so easy in standard C++.
2023-10-18 11:25:34 +02:00
Sebastian Huber
a4e1b7fff8 linker: Fix typo in symbol table generator
Updates #4920.
2023-10-18 11:25:34 +02:00
Chris Johns
aba4d3b8da linker: Add TLS support to the symbol table generator
Updates #4920
2023-08-17 12:53:30 +10:00
Kinsey Moore
6970c47c70 linkers/rtems-syms: Generate TLS symbols
When generating the symbol table for loadable modules, include TLS
symbols so that the modules can reference them.
2023-01-17 09:32:45 -06:00
Ryan Long
ace7db96d4 rtems-syms.cpp: Change check to pointer size
Changed from a RISC-V specific value being in the conditional to a check for
the size of the architecture's pointer.

Closes #4673
2022-07-29 08:25:35 -05:00
Hesham Almatary
a1c0f92883 rtems-syms: Use .quad instead of .long for riscv64
.long in RISC-V assembly is 4 bytes, while the address in riscv64
is 8 bytes (.quad). Moreover, RTEMS' libdl increases the symbols
pointer by sizeof(long) in C when iterating over global symbols.
2019-11-12 10:19:58 +00:00
Chris Johns
6e0f49a94a linkers/syms: Add symbol filtering.
- Filter symbols by regx.
- Return the name of a symbol via demangled() even it is not
  a mangled C++ function.
2019-02-11 16:42:53 +11:00
Chris Johns
3d2db56f7d Fix warnings on Windows. 2018-11-29 05:45:21 +11:00
Chris Johns
e4b31433e2 rtems-syms: Fix usage help. 2017-03-15 15:23:05 +11:00
Chris Johns
885aebd6b3 linkers/syms: Add weak symbols to the global symbol table.
Add any weak symbols that have been linked into the base image to the
global symbol table. A weak symbol is global when view viewed from
a dynamically loaded module.

Closes #2704.
2016-08-25 15:54:23 +10:00
Sebastian Huber
f027f37661 linkers: Fix for targets with a small-data area
On certain targets (e.g. PowerPC) global data below a certain threshold
(e.g. 8 bytes) may resided in a special memory area, the small-data
area.  This allows more efficient load/store operations.  Placing such
data into the wrong section (e.g. .rodata) leads to relocation errors
during link-time.  See test program libtests/dl02 in the RTEMS
testsuite.  Using an array of unspecified size prevents that the
compiler assumes that a certain variable is in the small-data area.
2016-01-05 07:05:52 +01:00
Sebastian Huber
a7951f2ca3 linkers: Avoid cast 2016-01-04 11:15:28 +01:00
Chris Johns
efc4f099b4 Add release versioning support.
Support a top level VERSION file that defines an RTEMS release.

Fix the install of the python modules including thertems-test.

Update the git python module to the RSB version. Fix the options to
not call clean and to call dirty.

Update the version python module.

Fix the rtld C++ support to the VERSION file and the top level waf
script.
2015-12-09 20:08:19 +11:00
Chris Johns
7338811607 Remove warning on Linux. 2015-01-21 10:52:54 +11:00
Chris Johns
b9c0a0436d linkers: Disable .type statements in symbol code.
Some of the assemblers do not support this statement.
2014-11-06 12:05:38 +11:00
Chris Johns
53e387d9a4 linkers: Merge the standard libraries into the user library paths.
The change to rld::split clears the user's library paths. Fix
this.
2014-11-04 19:39:57 +11:00
Ben Gras
2015c854c5 fix for open() not taking a std::string 2014-11-01 09:56:05 +11:00
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
8807135964 Refactor the CC flags. Fix the various linkers. The trace linker is compiling. 2014-09-06 20:19:45 +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
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
6c4218becf Fix the trace help. 2013-03-01 11:51:37 +11:00
Chris Johns
8190102ee7 Update to the latest framwork requirements. 2012-11-26 12:14:06 +11:00
Chris Johns
9ba4e484ab Remove the warning about the warnings option on newer gccs. 2012-11-21 12:12:50 +11:00
Chris Johns
9b66527beb Only look for standard library paths if standard libraries and enabled. 2012-11-19 13:13:52 +11:00
Chris Johns
977c3de534 Refactor the ELF support to allow ELF write suppport.
The refactoring allows better reuse of the ELF support and cleans up
some hacks from the generic file and archive handling improving the
separation of the file handling from the file format, ie ELF. The
handling of ELF object files and ELF object files inside archives
is cleaner.

The refactor cleaned up the symbol handling where the symbols now
reside in the ELF file object and references are take in symbol
pointer containers and symbol table containers.

The main purpose of the refactor is to allow support for creating
and writing ELF files.

Also added an rtems-syms command where special symbol support
can be added.
2012-11-17 17:34:33 +11:00