Skip to content

Commit

Permalink
Merge branch 'main' into MofX
Browse files Browse the repository at this point in the history
  • Loading branch information
Serge Lamikhov-Center committed Jun 6, 2024
2 parents d33fadb + 1b1bd73 commit 75c4864
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions elfio/elf_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,30 @@ constexpr unsigned R_386_IRELATIVE = 42;
constexpr unsigned R_386_GOT32X = 43;
constexpr unsigned R_X86_64_GNU_VTINHERIT = 250;
constexpr unsigned R_X86_64_GNU_VTENTRY = 251;
// Arm
constexpr unsigned R_ARM_NONE = 0;
constexpr unsigned R_ARM_PC24 = 1;
constexpr unsigned R_ARM_ABS32 = 2;
constexpr unsigned R_ARM_REL32 = 3;
constexpr unsigned R_ARM_CALL = 28;
constexpr unsigned R_ARM_JUMP24 = 29;
constexpr unsigned R_ARM_TARGET1 = 38;
constexpr unsigned R_ARM_V4BX = 40;
constexpr unsigned R_ARM_PREL31 = 42;
constexpr unsigned R_ARM_MOVW_ABS_NC = 43;
constexpr unsigned R_ARM_MOVT_ABS = 44;
constexpr unsigned R_ARM_MOVW_PREL_NC = 45;
constexpr unsigned R_ARM_MOVT_PREL = 46;
constexpr unsigned R_ARM_ALU_PC_G0_NC = 57;
constexpr unsigned R_ARM_ALU_PC_G1_NC = 59;
constexpr unsigned R_ARM_LDR_PC_G2 = 63;
// Arm thumb
constexpr unsigned R_ARM_THM_CALL = 10;
constexpr unsigned R_ARM_THM_JUMP24 = 30;
constexpr unsigned R_ARM_THM_MOVW_ABS_NC = 47;
constexpr unsigned R_ARM_THM_MOVT_ABS = 48;
constexpr unsigned R_ARM_THM_MOVW_PREL_NC = 49;
constexpr unsigned R_ARM_THM_MOVT_PREL = 50;
// AArch64
constexpr unsigned R_AARCH64_NONE = 0;
constexpr unsigned R_AARCH64_P32_ABS32 = 1;
Expand Down
2 changes: 1 addition & 1 deletion elfio/elfio_section.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ template <class T> class section_impl : public section
Elf_Xword size = get_size();
if ( nullptr == data && SHT_NULL != get_type() &&
SHT_NOBITS != get_type() &&
( sh_offset + size ) <= get_stream_size() ) {
sh_offset <= get_stream_size() && size <= (get_stream_size() - sh_offset)) {
data.reset( new ( std::nothrow ) char[size_t( size ) + 1] );

if ( ( 0 != size ) && ( nullptr != data ) ) {
Expand Down

0 comments on commit 75c4864

Please sign in to comment.