510 Commits

Author SHA1 Message Date
Chris Johns
076d935331 Add writing from images as well as streaming operators.
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.
2012-11-26 11:04:57 +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
4c89c2ddd1 Update the section details. 2012-11-26 10:59:19 +11:00
Chris Johns
c6b714f92f Load the sections by default. It is not much extra overhead.
Clean up the error messages.
Remove the copy constructor call on creating sections.
Change the symbols trace to the new symbols trace level.
2012-11-26 10:57:29 +11:00
Chris Johns
1d60a4ae57 Split trace to have without and with symbols. 2012-11-26 10:46:40 +11:00
Chris Johns
3f37835cf4 Split out the compression code for reuse. 2012-11-22 16:22:22 +11:00
Chris Johns
c2657cdc11 Clean archive names for every output format other than scripts. 2012-11-21 17:40:44 +11:00
Chris Johns
7b2762fe14 Make the entry point an unresolved symbol. 2012-11-21 13:36:32 +11:00
Chris Johns
43ec8b0e3e Set the default value for empty symbols to 0 to match the const char* signature. 2012-11-21 13:36:04 +11:00
Chris Johns
c46980ee88 Add entry point support. 2012-11-21 13:04:47 +11:00
Chris Johns
b770b0c8da Make getting objects const. 2012-11-21 13:04:19 +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
6565f0c056 Enforce the header is created before using it on Linux. 2012-11-21 12:12:21 +11:00
Chris Johns
c1d16362b8 Add header to remove warning on Linux. 2012-11-21 12:11:49 +11:00
Chris Johns
eb34811206 Output application format files.
Added support for an RTEMS RAP format application file. The format is:

 <header>
 <LZ77>
  <Application Script>
  <[1..n] ELF Object files>
 </LZ77>

Where the header is a text string of fields delimited by ',' and terminated
with a line feed (\n). It is variable length:

  RTEMS-APP,0000000,01.00.00,LZ77,00000000\n\0

  where:
   RTEMS-APP     : file tag for quick acceptance and rejection
   Length        : the length of the application in bytes including the
                 : header
   Version       : Version of the application format.
   Compress      : The compression format.
   Checksum      : CCITT CRC32 checksum.

Following the header is a nul ('\0') character then an LZ77 container
with the application loader script followed by the ELF object files.

Note, the script format will be documented else where.

Note, the final version may add a 32bit length field before each part
in the compressed container to delimit the size of the file to be
read. This is currently not in this version.
2012-11-21 11:07:12 +11:00
Chris Johns
a1d4930283 Set the correct header size field. 2012-11-21 11:05:04 +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
9b66527beb Only look for standard library paths if standard libraries and enabled. 2012-11-19 13:13:52 +11:00
Chris Johns
596e5fa591 Add set_header support to the ELF files. 2012-11-19 10:37:37 +11:00
Chris Johns
1976825c78 Resolve the ld and user undefines. 2012-11-19 10:36:34 +11:00
Chris Johns
ead8da1e33 Add configure option --c-opts to allow special options for testing. 2012-11-19 10:35:51 +11:00
Chris Johns
8ad4837168 Fix warning from clang. 2012-11-19 10:35:15 +11:00
Chris Johns
f1cf3a9dd3 Better handling of archive open/close and begin/end. 2012-11-18 07:37:02 +11:00
Chris Johns
065ac15a40 Remove dead code. 2012-11-17 17:42:22 +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
0b65a28b57 Fix spelling. 2012-11-17 17:31:56 +11:00
Chris Johns
16e43468ec Add FastLZ support. 2012-10-22 18:46:59 -07:00
Chris Johns
810d0ad976 Fix repeats in output when cmd line objects depend on each other.
If an object on the command line depends on another object the output
code wrote the object files and then the dependent files and a
command line object file that is dependent ended up in the object
and dependent lists. A simple merge and unique fixed it.

Also moved the script generation code into a separate function
that can be used in a application container.
2012-10-22 17:58:34 -07:00
Chris Johns
7ec2c5a27c Ignore working files. 2012-10-22 07:12:47 -07:00
Chris Johns
8f0740b7c7 Script to test the linker. Run after building the linker. 2012-10-22 07:12:29 -07:00
Chris Johns
898fa1327f Fix the verbose level. 2012-10-22 07:11:04 -07:00
Chris Johns
8d1ab1f664 Add script output dbug messages. 2012-10-22 07:10:45 -07:00
Chris Johns
ef4061f226 Fix the command line arguments help. 2012-10-22 07:10:23 -07:00
Chris Johns
746192499f Rename rld-gcc. Add -C option.
Add a -C (also --cc) option to allow the CC to be used when linking to be
provided by the user rather than using the path. This support allows user
who work with the full path to tools rather than the environment to make
use of the linker without them needing to play with environment table.

Rename rld-gcc.[h.cpp] to rld-cc.[h,cpp] because gcc may not be the
only compiler/linker used by the RTEMS project.
2012-09-17 10:13:55 +10:00
Chris Johns
aef6d90180 Update the help to something useful. 2012-09-17 09:37:29 +10:00
Chris Johns
1ec9633dec Add rebuild and tags build commands 2012-09-17 09:37:07 +10:00
Chris Johns
993aa67acf Fix the waf script. 2012-09-15 17:58:00 +10:00
Chris Johns
7234c70492 Move .cvsignore to .gitignore. Update ChangeLog. 2012-09-06 14:09:49 +10:00
Chris Johns
68c9b8a35d Remove CVS Id and update the copyright year. 2012-08-04 22:29:24 +10:00
Chris Johns
5a4412234d Comments clean up. 2012-08-04 22:17:50 +10:00
Chris Johns
e80176246b Use the crossrpms repo and not the RTEMS source. 2012-08-04 22:17:33 +10:00
Chris Johns
db789e3577 Clean up. 2012-08-04 22:17:05 +10:00
Chris Johns
f51e6914b8 Do not build with zlib. 2012-08-04 22:16:48 +10:00
Chris Johns
ec24a379bc Add to git. 2012-05-07 08:47:11 +10:00
Chris Johns
6b88114668 Add /usr/local to the host cflags on FreeBSD. 2011-12-06 23:44:37 +00:00
Chris Johns
8548cd7915 Add a hack to work around make not being a macro in the spec files. 2011-12-06 06:37:57 +00:00
Chris Johns
594f41f133 Fix the host verison in FreeBSD. Allow the top of the src to crossrpms. 2011-12-05 20:53:17 +00:00
Chris Johns
a2bc901a20 Add FreeBSD support. 2011-12-05 11:32:44 +00:00
Chris Johns
a86cd82f73 2011-06-09 Chris Johns <chrisj@rtems.org>
* specbuilder/specbuilder/build.py,
        specbuilder/specbuilder/crossgcc.py,
        specbuilder/specbuilder/defaults.py,
        specbuilder/specbuilder/linux.py,
        specbuilder/specbuilder/spec.py: Add CentOS support for older
        Pythons. Add options to build the tools with specific flags.
2011-06-09 05:59:32 +00:00