Skip to content

Commit

Permalink
add SHN_, PF_, DT_VERSYM constants.
Browse files Browse the repository at this point in the history
These constants are used by alternate saver of patchelf.rb
  • Loading branch information
rmNULL committed Aug 19, 2020
1 parent 66189a9 commit c47b5d4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/elftools/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ module DT
DT_VERDEF = 0x6ffffffc # address of version definition table
DT_VERDEFNUM = 0x6ffffffd # number of entries in {DT_VERDEF}
DT_VERNEED = 0x6ffffffe # address of version dependency table
DT_VERSYM = 0x6ffffff0 # section address of .gnu.version.
DT_VERNEEDNUM = 0x6fffffff # number of entries in {DT_VERNEED}
# Values between {DT_LOPROC} and {DT_HIPROC} are reserved for processor-specific semantics.
DT_LOPROC = 0x70000000
Expand Down Expand Up @@ -212,6 +213,15 @@ def self.mapping(type)
end
include ET

# segment permission flags, bitwise ored value is recorded in +p_flags+
# similar to unix permissions
module PF
PF_X = 1
PF_W = 2
PF_R = 4
end
include PF

# Program header types, records in +p_type+.
module PT
PT_NULL = 0 # null segment
Expand All @@ -233,6 +243,13 @@ module PT
end
include PT

# special indices to section header, used when there is no reference to section header
module SHN
SHN_UNDEF = 0 # undefined section
SHN_LORESERVE = 0xff00 # start of reserved indices
end
include SHN

# Section header types, records in +sh_type+.
module SHT
SHT_NULL = 0 # null section
Expand Down

0 comments on commit c47b5d4

Please sign in to comment.