13 Commits

Author SHA1 Message Date
Chris Johns
53221a0485 Add object::get_section.
Add a method to return a section given the ELF section index.

Add more trace output for debugging.
2012-12-18 20:52:18 +11:00
Chris Johns
d54e81c971 Debug trace changes. 2012-12-15 23:19:21 +11:00
Chris Johns
42f766f0ca Relocation fixes.
These changes implement a suitable relocation output in the image.
The code is still not working 100% but these changes are a big
improvement.
2012-12-12 21:51:03 +11:00
Chris Johns
90d8d43e4b Add support to demand load relocation records.
Support has been added to load relocation record on demand. The
relocation records are not read when the object file is first
opened and read. They are read only when being written to the
output file. This save loading lots of records into memory
from libraries to be thrown away.

The RAP format now supports writing out relocation records.
2012-12-08 09:07:30 +11:00
Chris Johns
662c504ee0 Add the index to the section.
The index is referenced in the symbol and relocation records of ELF files
therefore we need to search for them.
2012-11-29 19:02:28 +11:00
Chris Johns
a5fcdd51b5 No archive begin/end on symbols load, image initialise fix, add sections.
Remove archive_begin/archive_end calls when loading symbols. The symbols
reference object files and they may reference archive and so the archives
need to be open and available. The archive begin/end must be handled at
a higher level in the program.

Fixed image initialisation where some constructors did not initialise
all class variables.

Add section support to the rld::files namespace. This allows section
information to be added to an object file without the ELF file
needing to available therefore removing the need for object file
remaining open all the time. These sections are a copy of the
information and can be copied and moved as needed. This is used
to make layouts.
2012-11-26 11:00:34 +11:00
Chris Johns
b770b0c8da Make getting objects const. 2012-11-21 13:04:19 +11:00
Chris Johns
fe19d0684a Fix archive GNU extension and make image read/write follow POSIX.
Fix the finding of a file name in the GNU extension for long names
in GNU archives so the correct location is referenced.

Made the image read and write routines keep reading if not all the
requested data is read or written due to possible signals.
2012-11-21 10:40:01 +11:00
Chris Johns
fd8a2c559f Add support to write a metadata ELF file.
This also adds support to the ELF classes that wrap libelf. While
this is now done and seems to work I will not be using an ELF
file to hold the metadata after all.
2012-11-20 19:53:24 +11:00
Chris Johns
596e5fa591 Add set_header support to the ELF files. 2012-11-19 10:37:37 +11:00
Chris Johns
f1cf3a9dd3 Better handling of archive open/close and begin/end. 2012-11-18 07:37:02 +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
Chris Johns
ec24a379bc Add to git. 2012-05-07 08:47:11 +10:00