Commit Graph

25 Commits

Author SHA1 Message Date
Serge Lamikhov-Center
b5332a5d5b 'note_section' member name is confusing now - template class is capable to work with segments now 2022-01-29 17:03:37 +02:00
Serge Lamikhov-Center
feee9d4ada note_segment_accessor added 2022-01-29 10:48:04 +02: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
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
a8831c5d74 Address warnings reported by MS VS analyzer 2020-10-30 18:06:26 +02:00
Serge Lamikhov-Center
3c434f7587 Address warnings reported by MS VS 2020-10-30 17:54:13 +02: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
5f904722f6 New machine numbers added 2020-08-08 08:23:25 -07:00
Serge Lamikhov-Center
b1961db18b Fix compilation warnings in VS 2019 v16.7.0 2020-08-07 20:27:13 +03:00
Serge Lamikhov-Center
453929342f Don't access a note entry in case namesz is less than 1 2020-05-29 05:26:43 -07:00
Vašek Potoček
972f89e022 Better support for read-only ELF access 2017-10-04 20:33:10 +03:00
Tobias Klauser
446e0c215c elfio_note: fix MSVC compiler warning
Fix the following MSVC compiler warning:

elfio/elfio_note.hpp(77): warning C4267: 'initializing' : conversion from 'size_t' to 'ELFIO::Elf_Word', possible loss of data

by changing the type of max_name_sizei to Elf_Xword, as
note_secton->get_size() returns Elf_Xword and note_start_positions also
contains members of type Elf_Xword.
2016-10-06 12:07:20 +02:00
Tobias Klauser
af4140a122 elfio: don't cast away const qualifiers
Don't cast away const qualifiers when accessing const data (e.g. section
data). This fixes the warnings such as the following when compiling with
GCC and the -Wcast-qual flag set:

warning: cast from type ‘const char*’ to type ‘ELFIO::Elf_Word* {aka unsigned int*}’ casts away qualifiers [-Wcast-qual]
2016-09-22 23:22:39 +03:00
Serge Lamikhov-Center
3c5620d46d Make note section entries for 64-bit ELF file be the same as for 32-bit file
There are discrepancies in documentations. SCO documentation
(http://www.sco.com/developers/gabi/latest/ch5.pheader.html#note_section)
requires 8 byte entries alignment for 64-bit ELF file,
but Oracle's definition uses the same structure
for 32-bit and 64-bit formats.
(https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-18048.html)

It looks like EM_X86_64 Linux implementation is similar to Oracle's
definition. Therefore, the same alignment works for both formats
2016-07-10 11:35:23 +03:00
Kevin Klues
e3e0d6dbdb Fixed off-by-one error in 'name' of add_note() function.
Previously, when assigning 'name' as a string, it's length was specified
using the full length of 'namesz'. However, this length includes the
trailing '\0' of the underlying char[]. This ultimately causes the C++
string that is created to (incorrectly) contain the '\0' character as
well. This leads to problems where e.g. the following will return false,
even when 'name' itself actually contains the string "GNU\0":

  if (name == "GNU") {
    return true;
  }
  return false;

To fix this, we should only include the length of the string minus the
trailing '\0'.
2016-07-02 11:02:20 -07:00
Serge Lamikhov-Center
5ec1fc8949 Prevent a crash when working with MN10300 ELF file 2015-02-25 00:57:51 +02:00
Serge Lamikhov-Center
9e4502d90e Copyright year update 2015-02-13 20:51:07 +02:00
Serge Lamikhov-Center
b78c0aca3d Convert all files to UNIX EOL 2012-11-27 11:45:28 +02:00
Serge Lamikhov-Center
b74f44443d 'add_entry' in symbol_section_accessor was renamed to 'add_symbol'
documentation update
<elfio.hpp> was modified to be <elfio/elfio.hpp>
2012-11-25 19:58:07 +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
493549e030 Initial 2012-02-18 12:01:36 +02:00