Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
The offsets of sections in objects have to be computed in load order
so the offsets work. For example an object could have a sections with
an alignment of 4 and 16 so the 4 may align with the current load
offset and the 16 is padded to align it. This is the way the image is
loaded and so the layout needs to follow these rules.
The strtab search needs to be better. An STL string find was finding
patrial strings and causing errors on the target.
|
|
|
|
Weak symbols where not being managed correctly. The symbols table
is now a class with externals and weaks as separate symtabs so
the externals can be searched first then the weaks and if not
found an unresolved error is raised. This was found creating
a libbsdport RAP file where the drivers in the all driver table
resolved to the weak symbols and so linking in nothing.
Fixing the weak symbols as found in the libbsdport library
triggered a new resolver bug. The object files now contain the
resolver state and this is used to determine if an object file
has been resolved or is currently being resolved avoiding
rescursive loops with dependent object files.
The resolver trace output is a little easier to read.
|
|
|
|
|
|
Moved the section trace output to after the offsets have been
computed and add this to the output. This allows a simple way
to track the offset in an ELF section to the offset in the RAP
section.
|
|
|
|
An overlay shows the hex dump of the section data with the relocation
records so you can see the relationship between the relocations and
the section data.
|
|
|
|
|
|
|
|
Set the compressed file length in the RAP header. Move
the string from the outputter to the RAP file.
Make the sections public by moving to the RAP header.
|
|
Make reading compressed files more robust returning the amount
of data that can be read. Also add >> operartors to get the
data. Add exceptions when a read fails.
|
|
|
|
|
|
The compressor can now decompress LZ77 files.
|
|
Numerous fixes to load the the libbsdport RAP file on the i386.
|
|
Add a method to return a section given the ELF section index.
Add more trace output for debugging.
|
|
|
|
The data pointer was not updating when looping.
Fix the total stats to track the data in the buffer.
|
|
|
|
|
|
|
|
Fix the size of the section calculated in image::lay_out. It did not
correctly adjust for alignment. Make the sections being written
correctly align.
|
|
|
|
These changes implement a suitable relocation output in the image.
The code is still not working 100% but these changes are a big
improvement.
|
|
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.
|
|
|
|
|
|
|
|
Do not write the script into the RAP file rather just write the
init and fini labels. These are appended to the string table and
offsets in the string table added to the image.
Fi the sizes so the sections can be correctly loaded on the target.
|
|
The file is a header and a searies of LZ77 blocks which hold the
application. The format allows for easy streaming and loading
on the target without needing the rewind or seek around the
file.
|
|
The LZ77 compressor works with blocks. Each block is prefixed with
a header that defines the output size of the block being compressed.
|
|
|
|
The index is referenced in the symbol and relocation records of ELF files
therefore we need to search for them.
|
|
|
|
|
|
On Darwin the operator works which on CentOS and FreeBSD it is seen
to be redefining the uint32_t stream operator. Too hard to provide
a generic solution so just cast in the user code.
|
|
|
|
|
|
|
|
|
|
Add an exit label that is called when removing an application.
Change the "applicatiion" to "elf_application" and add a custom
format called the RAP format for applications.
|
|
Add the ability to write to the compressed stream directly from
files::images.
Add streaming operator support which is always in a standard byte
format in the output image.
|
|
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.
|