ó
™^c           @   sy   d  d l  m Z d e f d „  ƒ  YZ d d d „  ƒ  YZ d d d „  ƒ  YZ d e f d	 „  ƒ  YZ d
 d d „  ƒ  YZ d S(   iÿÿÿÿ(   t   IntEnumt   SymbolBindingc           B   s   e  Z d  Z d Z d Z RS(   i    i   i   (   t   __name__t
   __module__t   localt   global_t   weak(    (    (    sG   /torch/pytorch/third_party/python-peachpy/peachpy/formats/elf/symbol.pyR      s   t
   SymbolTypec           B   s&   e  Z d  Z d Z d Z d Z d Z RS(   i    i   i   i   i   (   R   R   t   unspecifiedt   data_objectt   functiont   sectiont   file(    (    (    sG   /torch/pytorch/third_party/python-peachpy/peachpy/formats/elf/symbol.pyR      s
   t   Symbolc           B   s)   e  Z d  „  Z e d „  ƒ Z d „  Z RS(   c         C   s:   d  |  _ d  |  _ d |  _ d |  _ d |  _ d  |  _ d  S(   Ni    (   t   Nonet   namet   valuet   sizet   bindingt   typeR   (   t   self(    (    sG   /torch/pytorch/third_party/python-peachpy/peachpy/formats/elf/symbol.pyt   __init__   s    					c         C   sS   d d l  m } t |  | ƒ s% t ‚ |  j d k s: t ‚ i d d 6d d 6|  j S(   Niÿÿÿÿ(   t   ABIi    i@   i   i   (   i    i@   (   t   peachpy.abiR   t
   isinstancet   AssertionErrort   elf_bitness(   t   abiR   (    (    sG   /torch/pytorch/third_party/python-peachpy/peachpy/formats/elf/symbol.pyt   get_entry_size)   s    c         C   sÉ  d d  l  } t | | j j ƒ s' t ‚ | j d k s< t ‚ |  j | k sQ t ‚ d d l m } |  j	 d  k s— t |  j	 | ƒ s— |  j	 | k s— t ‚ | |  j } | j } |  j	 d  k	 rê t |  j	 | ƒ rÚ |  j	 } qê | |  j	 } n  | j d k r_| j | ƒ | j |  j ƒ | j |  j ƒ | j |  j d >|  j d @Bƒ | j d ƒ | j | ƒ S| j | ƒ | j |  j d >|  j d @Bƒ | j d ƒ | j | ƒ | j |  j ƒ | j |  j ƒ Sd  S(	   Niÿÿÿÿi    i@   (   t   SectionIndexi   i   i    (   i    i@   (   t   peachpy.encoderR   t   encodert   EncoderR   t   bitnessR   t   peachpy.formats.elf.sectionR   R   R   t   absolutet   uint32R   R   t   uint8R   R   t   uint16t   uint64(   R   R   t   name_index_mapt   section_index_mapt   peachpyR   t
   name_indext   section_index(    (    sG   /torch/pytorch/third_party/python-peachpy/peachpy/formats/elf/symbol.pyt   encode1   s"    6	XU(   R   R   R   t   staticmethodR   R-   (    (    (    sG   /torch/pytorch/third_party/python-peachpy/peachpy/formats/elf/symbol.pyR      s   	t   RelocationTypec           B   s€  e  Z d  Z d Z d Z d Z d Z d Z d Z d Z	 d Z
 d	 Z d  Z d Z d Z d Z d Z d Z d Z d Z d Z d	 Z d
 Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z  d Z! d Z" d Z# d Z$ d Z% d Z& d Z' d Z( d Z) d Z* d Z+ d  Z, d! Z- d" Z. d# Z/ d$ Z0 d Z1 d Z2 d Z3 d Z4 d Z5 d Z6 d Z7 d Z8 d	 Z9 d
 Z: d Z; d Z< d Z= d Z> d Z? d Z@ d ZA d ZB d ZC d ZD d ZE d ZF d ZG d ZH d ZI d ZJ d ZK d% ZL d& ZM d' ZN d( ZO d) ZP d* ZQ d+ ZR d, ZS d- ZT d. ZU d/ ZV d0 ZW d1 ZX d2 ZY d3 ZZ d4 Z[ d5 Z\ d6 Z] d7 Z^ d8 Z_ d9 Z` d: Za d; Zb d< Zc d= Zd d> Ze d? Zf d@ Zg dA Zh dB Zi dC Zj dD Zk dE Zl dF Zm dG Zn dH Zo dI Zp dJ Zq dK Zr dL Zs dM Zt dN Zu dO Zv dP Zw dQ Zx dR Zy dS Zz dT Z{ dU Z| dV Z} dW Z~ dX Z dY Z€ dZ Z� d[ Z‚ d\ Zƒ d] Z„ d^ Z… d_ Z† d` Z‡ da Zˆ db Z‰ dc ZŠ dd Z‹ de ZŒ df Z� dg ZŽ dh Z� di Z� dj Z‘ dk Z’ dl Z“ dm Z” dn Z• RS(o   i   i   i   i   i   i   i   i   i	   i
   i   i   i   i   i   i   i   i   i   i   i   i   i   i   i   i   i   i   i   i   i   i    i!   i"   i#   i$   i%   i&   i(   i)   i*   i+   i,   i-   i.   i/   i0   i1   i2   i3   i4   i5   i6   i7   i8   i9   i:   i;   i<   i=   i>   i?   i@   iA   iB   iC   iD   iE   iF   iG   iH   iI   iJ   iK   iL   iM   iN   iO   iP   iQ   iR   iS   iT   iU   iV   iW   iX   iY   iZ   i[   i\   i]   i^   i_   i`   ia   ib   ic   if   ig   ih   ii   ij   ik   il   im   in   io   i�   i‚   iƒ   (–   R   R   t   x86_32t   x86_pc32t	   x86_got32t	   x86_plt32t   x86_copyt   x86_glob_datt   x86_jmp_slott   x86_relativet
   x86_gotofft	   x86_gotpct	   x86_64_64t   x86_64_pc32t   x86_64_got32t   x86_64_plt32t   x86_64_copyt   x86_64_glob_datt   x86_64_jump_slott   x86_64_relativet   x86_64_gotpcrelt	   x86_64_32t
   x86_64_32st	   x86_64_16t   x86_64_pc16t   x86_64_8t
   x86_64_pc8t   x86_64_dtpmod64t   x86_64_dtpoff64t   x86_64_tpoff64t   x86_64_tlsgdt   x86_64_tlsldt   x86_64_dtpoff32t   x86_64_gottpofft   x86_64_tpoff32t   x86_64_pc64t   x86_64_gotoff64t   x86_64_gotpc32t   x86_64_got64t   x86_64_gotpcrel64t   x86_64_gotpc64t   x86_64_gotplt64t   x86_64_pltoff64t   x86_64_size32t   x86_64_size64t   x86_64_gotpc32_tlsdesct   x86_64_tlsdesc_callt   x86_64_tlsdesct   x86_64_irelativet	   arm_abs32t	   arm_rel32t   arm_ldr_pc_g0t	   arm_abs16t	   arm_abs12t   arm_thm_abs5t   arm_abs8t   arm_sbrel32t   arm_thm_callt   arm_thm_pc8t   arm_brel_adjt   arm_tls_desct   arm_tls_dtpmod32t   arm_tls_dtpoff32t   arm_tls_tpoff32t   arm_copyt   arm_glob_datt   arm_jump_slott   arm_relativet   arm_gotoff32t   arm_base_prelt   arm_got_brelt	   arm_plt32t   arm_callt
   arm_jump24t   arm_thm_jump24t   arm_base_abst   arm_target1t   arm_v4bxt   arm_target2t
   arm_prel31t   arm_movw_abs_nct   arm_movt_abst   arm_movw_prel_nct   arm_movt_prelt   arm_thm_movw_abs_nct   arm_thm_movt_abst   arm_thm_movw_prel_nct   arm_thm_movt_prelt   arm_thm_jump19t   arm_thm_jump6t   arm_thm_alu_prel_11_0t   arm_thm_pc12t   arm_abs32_noit   arm_rel32_noit   arm_alu_pc_g0_nct   arm_alu_pc_g0t   arm_alu_pc_g1_nct   arm_alu_pc_g1t   arm_alu_pc_g2t   arm_ldr_pc_g1t   arm_ldr_pc_g2t   arm_ldrs_pc_g0t   arm_ldrs_pc_g1t   arm_ldrs_pc_g2t   arm_ldc_pc_g0t   arm_ldc_pc_g1t   arm_ldc_pc_g2t   arm_alu_sb_g0_nct   arm_alu_sb_g0t   arm_alu_sb_g1_nct   arm_alu_sb_g1t   arm_alu_sb_g2t   arm_ldr_sb_g0t   arm_ldr_sb_g1t   arm_ldr_sb_g2t   arm_ldrs_sb_g0t   arm_ldrs_sb_g1t   arm_ldrs_sb_g2t   arm_ldc_sb_g0t   arm_ldc_sb_g1t   arm_ldc_sb_g2t   arm_movw_brel_nct   arm_movt_brelt   arm_movw_brelt   arm_thm_movw_brel_nct   arm_thm_movt_brelt   arm_thm_movw_brelt   arm_tls_gotdesct   arm_tls_callt   arm_tls_descseqt   arm_thm_tls_callt   arm_plt32_abst   arm_got_abst   arm_got_prelt   arm_got_brel12t   arm_gotoff12t   arm_gotrelaxt   arm_thm_jump11t   arm_thm_jump8t   arm_tls_gd32t   arm_tls_ldm32t   arm_tls_ldo32t   arm_tls_ie32t   arm_tls_le32t   arm_tls_ldo12t   arm_tls_le12t   arm_tls_ie12gpt   arm_thm_tls_descseq16t   arm_thm_tls_descseq32t   arm_thm_got_brel12(    (    (    sG   /torch/pytorch/third_party/python-peachpy/peachpy/formats/elf/symbol.pyR/   P   s(  t   RelocationWithAddendc           B   s)   e  Z d  „  Z e d „  ƒ Z d „  Z RS(   c         C   sŒ   d d l  m } m } t | t ƒ s+ t ‚ | | ƒ s= t ‚ t | t ƒ sR t ‚ | | ƒ sd t ‚ | |  _ | |  _ | |  _	 | |  _
 d  S(   Niÿÿÿÿ(   t	   is_uint64t	   is_sint64(   t   peachpy.utilRÅ   RÆ   R   R/   R   R   R   t   offsett   symbolt   addend(   R   R   RÈ   RÉ   RÊ   RÅ   RÆ   (    (    sG   /torch/pytorch/third_party/python-peachpy/peachpy/formats/elf/symbol.pyR   ê   s    			c         C   sS   d d l  m } t |  | ƒ s% t ‚ |  j d k s: t ‚ i d d 6d d 6|  j S(   Niÿÿÿÿ(   R   i    i@   i   i   (   i    i@   (   R   R   R   R   R   (   R   R   (    (    sG   /torch/pytorch/third_party/python-peachpy/peachpy/formats/elf/symbol.pyR   ö   s    c         C   sœ   d d  l  } t | | j j ƒ s' t ‚ | j d k s< t ‚ |  j | k sQ t ‚ | |  j } | d >|  j B} | j |  j	 ƒ | j | ƒ | j
 |  j ƒ S(   Niÿÿÿÿi    i@   (   i    i@   (   R   R   R   R    R   R!   RÉ   R   t   unsigned_offsetRÈ   t   signed_offsetRÊ   (   R   R   t   symbol_index_mapR*   t   symbol_indext   info(    (    sG   /torch/pytorch/third_party/python-peachpy/peachpy/formats/elf/symbol.pyR-   þ   s    (   R   R   R   R.   R   R-   (    (    (    sG   /torch/pytorch/third_party/python-peachpy/peachpy/formats/elf/symbol.pyRÄ   é   s   	N(    (    (    (   t   enumR    R   R   R   R/   RÄ   (    (    (    sG   /torch/pytorch/third_party/python-peachpy/peachpy/formats/elf/symbol.pyt   <module>   s
   6™