From: Eli Bendersky Date: Sat, 8 Jun 2013 22:39:18 +0000 (-0700) Subject: Merge pull request #16 X-Git-Tag: v0.22~37 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3fd50efb6d65a7d90a191572a3c088b455893b27;p=pyelftools.git Merge pull request #16 --- 3fd50efb6d65a7d90a191572a3c088b455893b27 diff --cc elftools/elf/descriptions.py index 0fd5877,81ba7ae..0b68165 --- a/elftools/elf/descriptions.py +++ b/elftools/elf/descriptions.py @@@ -7,9 -7,9 +7,9 @@@ # This code is in the public domain #------------------------------------------------------------------------------- from .enums import ( - ENUM_D_TAG, ENUM_E_VERSION, ENUM_RELOC_TYPE_i386, ENUM_RELOC_TYPE_x64 - ) + ENUM_D_TAG, ENUM_E_VERSION, ENUM_RELOC_TYPE_i386, ENUM_RELOC_TYPE_x64, + ENUM_RELOC_TYPE_ARM, ENUM_RELOC_TYPE_AARCH64) -from .constants import P_FLAGS, SH_FLAGS, SUNW_SYMINFO_FLAGS +from .constants import P_FLAGS, SH_FLAGS, SUNW_SYMINFO_FLAGS, VER_FLAGS from ..common.py3compat import iteritems diff --cc elftools/elf/enums.py index 5fd8238,7989f49..deb9f35 --- a/elftools/elf/enums.py +++ b/elftools/elf/enums.py @@@ -454,22 -465,247 +465,264 @@@ ENUM_SUNW_SYMINFO_BOUNDTO = dict SYMINFO_BT_NONE=0xfffd, SYMINFO_BT_EXTERN=0xfffc, _default_=Pass, +) + +# Versym section, version dependency index +ENUM_VERSYM = dict( + VER_NDX_LOCAL=0, + VER_NDX_GLOBAL=1, + VER_NDX_LORESERVE=0xff00, + VER_NDX_ELIMINATE=0xff01, + _default_=Pass, +) +# Sunw Syminfo Bound To special values +ENUM_SUNW_SYMINFO_BOUNDTO = dict( + SYMINFO_BT_SELF=0xffff, + SYMINFO_BT_PARENT=0xfffe, + SYMINFO_BT_NONE=0xfffd, + SYMINFO_BT_EXTERN=0xfffc, + _default_=Pass, ) + ENUM_RELOC_TYPE_ARM = dict( + R_ARM_NONE=0, + R_ARM_PC24=1, + R_ARM_ABS32=2, + R_ARM_REL32=3, + R_ARM_LDR_PC_G0=4, + R_ARM_ABS16=5, + R_ARM_ABS12=6, + R_ARM_THM_ABS5=7, + R_ARM_ABS8=8, + R_ARM_SBREL32=9, + R_ARM_THM_CALL=10, + R_ARM_THM_PC8=11, + R_ARM_BREL_ADJ=12, + R_ARM_SWI24=13, + R_ARM_THM_SWI8=14, + R_ARM_XPC25=15, + R_ARM_THM_XPC22=16, + R_ARM_TLS_DTPMOD32=17, + R_ARM_TLS_DTPOFF32=18, + R_ARM_TLS_TPOFF32=19, + R_ARM_COPY=20, + R_ARM_GLOB_DAT=21, + R_ARM_JUMP_SLOT=22, + R_ARM_RELATIVE=23, + R_ARM_GOTOFF32=24, + R_ARM_BASE_PREL=25, + R_ARM_GOT_BREL=26, + R_ARM_PLT32=27, + R_ARM_CALL=28, + R_ARM_JUMP24=29, + R_ARM_THM_JUMP24=30, + R_ARM_BASE_ABS=31, + R_ARM_ALU_PCREL_7_0=32, + R_ARM_ALU_PCREL_15_8=33, + R_ARM_ALU_PCREL_23_15=34, + R_ARM_LDR_SBREL_11_0_NC=35, + R_ARM_ALU_SBREL_19_12_NC=36, + R_ARM_ALU_SBREL_27_20_CK=37, + R_ARM_TARGET1=38, + R_ARM_SBREL31=39, + R_ARM_V4BX=40, + R_ARM_TARGET2=41, + R_ARM_PREL31=42, + R_ARM_MOVW_ABS_NC=43, + R_ARM_MOVT_ABS=44, + R_ARM_MOVW_PREL_NC=45, + R_ARM_MOVT_PREL=46, + R_ARM_THM_MOVW_ABS_NC=47, + R_ARM_THM_MOVT_ABS=48, + R_ARM_THM_MOVW_PREL_NC=49, + R_ARM_THM_MOVT_PREL=50, + R_ARM_THM_JUMP19=51, + R_ARM_THM_JUMP6=52, + R_ARM_THM_ALU_PREL_11_0=53, + R_ARM_THM_PC12=54, + R_ARM_ABS32_NOI=55, + R_ARM_REL32_NOI=56, + R_ARM_ALU_PC_G0_NC=57, + R_ARM_ALU_PC_G0=58, + R_ARM_ALU_PC_G1_NC=59, + R_ARM_ALU_PC_G1=60, + R_ARM_ALU_PC_G2=61, + R_ARM_LDR_PC_G1=62, + R_ARM_LDR_PC_G2=63, + R_ARM_LDRS_PC_G0=64, + R_ARM_LDRS_PC_G1=65, + R_ARM_LDRS_PC_G2=66, + R_ARM_LDC_PC_G0=67, + R_ARM_LDC_PC_G1=68, + R_ARM_LDC_PC_G2=69, + R_ARM_ALU_SB_G0_NC=70, + R_ARM_ALU_SB_G0=71, + R_ARM_ALU_SB_G1_NC=72, + R_ARM_ALU_SB_G1=73, + R_ARM_ALU_SB_G2=74, + R_ARM_LDR_SB_G0=75, + R_ARM_LDR_SB_G1=76, + R_ARM_LDR_SB_G2=77, + R_ARM_LDRS_SB_G0=78, + R_ARM_LDRS_SB_G1=79, + R_ARM_LDRS_SB_G2=80, + R_ARM_LDC_SB_G0=81, + R_ARM_LDC_SB_G1=82, + R_ARM_LDC_SB_G2=83, + R_ARM_MOVW_BREL_NC=84, + R_ARM_MOVT_BREL=85, + R_ARM_MOVW_BREL=86, + R_ARM_THM_MOVW_BREL_NC=87, + R_ARM_THM_MOVT_BREL=88, + R_ARM_THM_MOVW_BREL=89, + R_ARM_PLT32_ABS=94, + R_ARM_GOT_ABS=95, + R_ARM_GOT_PREL=96, + R_ARM_GOT_BREL12=97, + R_ARM_GOTOFF12=98, + R_ARM_GOTRELAX=99, + R_ARM_GNU_VTENTRY=100, + R_ARM_GNU_VTINHERIT=101, + R_ARM_THM_JUMP11=102, + R_ARM_THM_JUMP8=103, + R_ARM_TLS_GD32=104, + R_ARM_TLS_LDM32=105, + R_ARM_TLS_LDO32=106, + R_ARM_TLS_IE32=107, + R_ARM_TLS_LE32=108, + R_ARM_TLS_LDO12=109, + R_ARM_TLS_LE12=110, + R_ARM_TLS_IE12GP=111, + R_ARM_PRIVATE_0=112, + R_ARM_PRIVATE_1=113, + R_ARM_PRIVATE_2=114, + R_ARM_PRIVATE_3=115, + R_ARM_PRIVATE_4=116, + R_ARM_PRIVATE_5=117, + R_ARM_PRIVATE_6=118, + R_ARM_PRIVATE_7=119, + R_ARM_PRIVATE_8=120, + R_ARM_PRIVATE_9=121, + R_ARM_PRIVATE_10=122, + R_ARM_PRIVATE_11=123, + R_ARM_PRIVATE_12=124, + R_ARM_PRIVATE_13=125, + R_ARM_PRIVATE_14=126, + R_ARM_PRIVATE_15=127, + R_ARM_ME_TOO=128, + R_ARM_THM_TLS_DESCSEQ16=129, + R_ARM_THM_TLS_DESCSEQ32=130, + R_ARM_THM_GOT_BREL12=131, + R_ARM_IRELATIVE=140, + ) + + ENUM_RELOC_TYPE_AARCH64 = dict( + R_AARCH64_NONE=256, + R_AARCH64_ABS64=257, + R_AARCH64_ABS32=258, + R_AARCH64_ABS16=259, + R_AARCH64_PREL64=260, + R_AARCH64_PREL32=261, + R_AARCH64_PREL16=262, + R_AARCH64_MOVW_UABS_G0=263, + R_AARCH64_MOVW_UABS_G0_NC=264, + R_AARCH64_MOVW_UABS_G1=265, + R_AARCH64_MOVW_UABS_G1_NC=266, + R_AARCH64_MOVW_UABS_G2=267, + R_AARCH64_MOVW_UABS_G2_NC=268, + R_AARCH64_MOVW_UABS_G3=269, + R_AARCH64_MOVW_SABS_G0=270, + R_AARCH64_MOVW_SABS_G1=271, + R_AARCH64_MOVW_SABS_G2=272, + R_AARCH64_LD_PREL_LO19=273, + R_AARCH64_ADR_PREL_LO21=274, + R_AARCH64_ADR_PREL_PG_HI21=275, + R_AARCH64_ADR_PREL_PG_HI21_NC=276, + R_AARCH64_ADD_ABS_LO12_NC=277, + R_AARCH64_LDST8_ABS_LO12_NC=278, + R_AARCH64_TSTBR14=279, + R_AARCH64_CONDBR19=280, + R_AARCH64_JUMP26=282, + R_AARCH64_CALL26=283, + R_AARCH64_LDST16_ABS_LO12_NC=284, + R_AARCH64_LDST32_ABS_LO12_NC=285, + R_AARCH64_LDST64_ABS_LO12_NC=286, + R_AARCH64_MOVW_PREL_G0=287, + R_AARCH64_MOVW_PREL_G0_NC=288, + R_AARCH64_MOVW_PREL_G1=289, + R_AARCH64_MOVW_PREL_G1_NC=290, + R_AARCH64_MOVW_PREL_G2=291, + R_AARCH64_MOVW_PREL_G2_NC=292, + R_AARCH64_MOVW_PREL_G3=293, + R_AARCH64_MOVW_GOTOFF_G0=300, + R_AARCH64_MOVW_GOTOFF_G0_NC=301, + R_AARCH64_MOVW_GOTOFF_G1=302, + R_AARCH64_MOVW_GOTOFF_G1_NC=303, + R_AARCH64_MOVW_GOTOFF_G2=304, + R_AARCH64_MOVW_GOTOFF_G2_NC=305, + R_AARCH64_MOVW_GOTOFF_G3=306, + R_AARCH64_GOTREL64=307, + R_AARCH64_GOTREL32=308, + R_AARCH64_GOT_LD_PREL19=309, + R_AARCH64_LD64_GOTOFF_LO15=310, + R_AARCH64_ADR_GOT_PAGE=311, + R_AARCH64_LD64_GOT_LO12_NC=312, + R_AARCH64_TLSGD_ADR_PREL21=512, + R_AARCH64_TLSGD_ADR_PAGE21=513, + R_AARCH64_TLSGD_ADD_LO12_NC=514, + R_AARCH64_TLSGD_MOVW_G1=515, + R_AARCH64_TLSGD_MOVW_G0_NC=516, + R_AARCH64_TLSLD_ADR_PREL21=517, + R_AARCH64_TLSLD_ADR_PAGE21=518, + R_AARCH64_TLSLD_ADD_LO12_NC=519, + R_AARCH64_TLSLD_MOVW_G1=520, + R_AARCH64_TLSLD_MOVW_G0_NC=521, + R_AARCH64_TLSLD_LD_PREL19=522, + R_AARCH64_TLSLD_MOVW_DTPREL_G2=523, + R_AARCH64_TLSLD_MOVW_DTPREL_G1=524, + R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC=525, + R_AARCH64_TLSLD_MOVW_DTPREL_G0=526, + R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC=527, + R_AARCH64_TLSLD_ADD_DTPREL_HI12=528, + R_AARCH64_TLSLD_ADD_DTPREL_LO12=529, + R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC=530, + R_AARCH64_TLSLD_LDST8_DTPREL_LO12=531, + R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC=532, + R_AARCH64_TLSLD_LDST16_DTPREL_LO12=533, + R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC=534, + R_AARCH64_TLSLD_LDST32_DTPREL_LO12=535, + R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC=536, + R_AARCH64_TLSLD_LDST64_DTPREL_LO12=537, + R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC=538, + R_AARCH64_TLSIE_MOVW_GOTTPREL_G1=539, + R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC=540, + R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21=541, + R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC=542, + R_AARCH64_TLSIE_LD_GOTTPREL_PREL19=543, + R_AARCH64_TLSLE_MOVW_TPREL_G2=544, + R_AARCH64_TLSLE_MOVW_TPREL_G1=545, + R_AARCH64_TLSLE_MOVW_TPREL_G1_NC=546, + R_AARCH64_TLSLE_MOVW_TPREL_G0=547, + R_AARCH64_TLSLE_MOVW_TPREL_G0_NC=548, + R_AARCH64_TLSLE_ADD_TPREL_HI12=549, + R_AARCH64_TLSLE_ADD_TPREL_LO12=550, + R_AARCH64_TLSLE_ADD_TPREL_LO12_NC=551, + R_AARCH64_TLSLE_LDST8_TPREL_LO12=552, + R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC=553, + R_AARCH64_TLSLE_LDST16_TPREL_LO12=554, + R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC=555, + R_AARCH64_TLSLE_LDST32_TPREL_LO12=556, + R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC=557, + R_AARCH64_TLSLE_LDST64_TPREL_LO12=558, + R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC=559, + R_AARCH64_COPY=1024, + R_AARCH64_GLOB_DAT=1025, + R_AARCH64_JUMP_SLOT=1026, + R_AARCH64_RELATIVE=1027, + R_AARCH64_TLS_DTPREL64=1028, + R_AARCH64_TLS_DTPMOD64=1029, + R_AARCH64_TLS_TPREL64=1030, + R_AARCH64_TLS_DTPREL32=1031, + R_AARCH64_TLS_DTPMOD32=1032, + R_AARCH64_TLS_TPREL32=1033, + ) diff --cc scripts/readelf.py index 06a6edd,e45de22..9839f71 --- a/scripts/readelf.py +++ b/scripts/readelf.py @@@ -37,8 -33,8 +37,9 @@@ from elftools.elf.descriptions import describe_sh_type, describe_sh_flags, describe_symbol_type, describe_symbol_bind, describe_symbol_visibility, describe_symbol_shndx, describe_reloc_type, describe_dyn_tag, + describe_ver_flags, ) + from elftools.elf.constants import E_FLAGS from elftools.dwarf.dwarfinfo import DWARFInfo from elftools.dwarf.descriptions import ( describe_reg_name, describe_attr_value, set_global_machine_arch,