Fix the following two gcc warnings:
elfio/elfio_section.hpp:50:36: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
const size_t get_stream_size() const
^
elfio/elfio_segment.hpp:99:23: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
get_stream_size() const
Fix crash b82f05b0b25c8fdc98480e6d76b6d5f9164ae2bc
Running: crash-b82f05b0b25c8fdc98480e6d76b6d5f9164ae2bc
==2850==WARNING: AddressSanitizer failed to allocate 0x400000004000001 bytes
==2850==AddressSanitizer's allocator is terminating the process instead of returning 0
==2850==If you don't like this behavior set allocator_may_return_null=1
==2850==AddressSanitizer CHECK failed: /home/alvaro/tools/llvm/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc:22
1 "((0)) != (0)" (0x0, 0x0)
Only elf files with strange GNU_RELRO segments fail the load, save, cycle.
It would maybe a good idea to separate the layout functionality from the
current save. The current coupling of layout and save make it
impossible to build layouts which contain the elf header via the public
API.
Many example elfs (hello_32, hello_64, asm ...) require that the
first section directly follows the program header table. The
section header is then placed between segments or at the end.
This change prepares the late placement of section header table.
We have some elf files where a section (.ARM.exidx) is located in multiple segments.
To keep this property it is necessary to keep track of the emitted sections.
Furthermore, the correct sequence for the segment emission has to be determined.
This is done by postponing segments which are actually a subsequence of another segment.
Additionally the alignment is not considered as part of the file size of a segment anymore.
Fix segment header position when no segments are present
Dumper - dynamic section output added
Dynamic section reader tests are added
Signed-off-by: Serge Lamikhov-Center <to_serge@users.sourceforge.net>