Commit Graph

44 Commits

Author SHA1 Message Date
Serge Lamikhov-Center
766559537a Hide non interface methods 2021-09-20 20:43:27 +03:00
Serge Lamikhov-Center
fbb852198e Use standard defined value for max ULL 2021-09-20 00:44:01 +03:00
Serge Lamikhov-Center
dad4b434c8 Use a different notation for the address translation 2021-09-20 00:03:21 +03:00
Serge Lamikhov-Center
511086598a Implement address translation for segments 2021-09-19 23:26:58 +03:00
Serge Lamikhov-Center
1343e5f979 modernize-use-equals-default 2021-08-26 13:01:12 +03:00
Serge Lamikhov-Center
da4f857e07 modernize-use-override 2021-08-26 12:57:31 +03:00
Serge Lamikhov-Center
4a84319bb8 modernize-use-nullptr 2021-08-26 12:52:23 +03:00
Serge Lamikhov-Center
1f79600cec Refactoring 2021-08-16 23:19:47 +03:00
Serge Lamikhov-Center
0fac6ce45b Add a convinience function 'add_section()' to segment class
It is not clear why this hasn't been done initially
2021-04-08 17:03:05 +03:00
Serge Lamikhov-Center
becd79d05c Support stringstream by filling gaps in output stream 2021-03-27 21:14:56 +03:00
Serge Lamikhov-Center
57e614a486 Remove postfix underscore in parameter names 2021-02-05 10:40:18 +02:00
Serge Lamikhov-Center
762c59a2bb Change copyright period 2021-01-19 09:43:01 +02:00
Serge Lamikhov-Center
937978973f Remove usage of try/catch blocks 2020-08-28 22:38:40 -07:00
Serge Lamikhov-Center
9c739b49a0 Reformat sources by using clang-format
It is not perfect (and, probably, it is worser than it was before), but, it is automatic
2020-08-21 07:56:08 -07:00
Serge Lamikhov-Center
c6e5eb0aad Update Copyright period 2020-08-19 13:47:20 -07:00
Serge Lamikhov-Center
15cd4b1bf2 Remove tabs 2019-04-28 09:00:14 +03:00
Gleb Struchalin
15340ddf9c Avoid warning about initialization reorder (-Wreorder) on GCC 2019-04-28 08:57:04 +03:00
Serge Lamikhov-Center
cdafaa0abf Prevent potential dereferencing of NULL pointer 2019-04-19 15:05:50 +03:00
Serge Lamikhov-Center
858b7a3b70 Names and tabs refactoring 2019-04-19 14:52:20 +03:00
Pavel I. Kryukov
e4abc190d6 Cast -1 to Elf_Half explicitly to suppress Visual Studio warning 2018-08-25 22:41:06 +03:00
Tobias Klauser
37ebcd91b8 Fix two gcc -Wignored-qualifiers warnings
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
2018-05-05 19:30:09 +03:00
alvaro
bd5f2128ae Check size for segment
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)
2017-10-04 20:47:51 +03:00
Serge Lamikhov-Center
8e7a29e128 Refactoring 2016-04-23 17:58:34 +03:00
Tim Strazzere
812f7299b3 Avoid SIGABRT due to over allocating during new instance of objects. 2016-04-23 16:37:48 +03:00
Serge Lamikhov-Center
9e4502d90e Copyright year update 2015-02-13 20:51:07 +02:00
Mario Werner
b91a43b378 special support for PHDR segments and segments which include the elf header
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.
2014-11-15 22:08:52 +01:00
Mario Werner
c743d0bf74 separated layout generation and saving
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.
2014-11-14 13:06:39 +01:00
Serge Lamikhov-Center
33dcaf063f Use [i|o]stream instead of [i|o]fstream; The patch was provided by Jason Hiser
Test's fixes
2014-02-26 18:02:30 +02:00
Serge Lamikhov-Center
17f03740e6 Using macros for header fields access functions
Set segment's index upon its creation
Move to VS2013 projects
2014-02-26 17:30:43 +02:00
Mario Werner
1d2930abc7 redesigned save_segments_and_their_sections
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.
2014-02-17 11:52:25 +01:00
Mario Werner
5dd8ba29bd assign sections to the segments during load based on the offsets 2014-02-13 18:59:16 +01:00
Mario Werner
f78a519522 removed const from the segment load function 2014-02-13 18:45:17 +01:00
Serge Lamikhov-Center
ec5ca1fa17 Ticket #9: Segment offset written in wrong endianess. 2013-04-20 01:27:29 +03:00
Serge Lamikhov-Center
4b7061dc92 Dynamic section accessor is implemented
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>
2013-01-13 04:29:43 +02:00
Serge Lamikhov-Center
b78c0aca3d Convert all files to UNIX EOL 2012-11-27 11:45:28 +02:00
Serge Lamikhov-Center
d3a0732983 Use <elfio/> prefix for \#include files 2012-11-25 14:37:09 +02:00
Serge Lamikhov-Center
3203483e34 Prevent compilation warnings when compiled x64 target with VS2008 2012-07-24 12:10:16 +03:00
Serge Lamikhov-Center
e1d554978d Trim trailing space and remove tabs 2012-06-24 09:02:32 +03:00
Serge Lamikhov-Center
b3b7aed245 Declaration uses macro for section and segment 2012-06-23 19:41:42 +03:00
Serge Lamikhov-Center
1a957edfba Don't calculate section address if it was already initialized 2012-06-03 23:19:33 +03:00
Serge Lamikhov-Center
8e3eedac9a Cosmetic 2012-03-11 22:39:27 +02:00
Serge Lamikhov-Center
9705f1ac35 Documentation update 2012-03-11 06:16:31 +02:00
Serge Lamikhov-Center
626ccc6cbd Make load/save functions of section/segment - private 2012-03-10 20:41:00 +02:00
Serge Lamikhov-Center
493549e030 Initial 2012-02-18 12:01:36 +02:00