ó
™^c           @   s|   d  d l  m Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d d d „  ƒ  YZ d e f d	 „  ƒ  YZ d
 d d „  ƒ  YZ d S(   iÿÿÿÿ(   t   IntEnumt   StorageClassc           B   s&   e  Z d  Z d Z d Z d Z d Z RS(   s�   
    External symbol. If section number is undefined (0), value specifies symbol size. Otherwise value specifies offset
    within section.
    i   i   ie   ig   (   t   __name__t
   __module__t   __doc__t   externalt   statict   functiont   file(    (    (    sJ   /torch/pytorch/third_party/python-peachpy/peachpy/formats/mscoff/symbol.pyR      s
   t
   SymbolTypec           B   s   e  Z d  Z d Z RS(   i    i    (   R   R   t   non_functionR   (    (    (    sJ   /torch/pytorch/third_party/python-peachpy/peachpy/formats/mscoff/symbol.pyR	      s   t   Symbolc           B   s    e  Z d  Z d „  Z d „  Z RS(   i   c         C   s1   d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  S(   N(   t   Nonet   namet   valuet   sectiont   symbol_typet   storage_class(   t   self(    (    sJ   /torch/pytorch/third_party/python-peachpy/peachpy/formats/mscoff/symbol.pyt   __init__    s
    				c   	      C   sÜ   d d l  m } t | | ƒ s% t ‚ y | j |  j d ƒ } Wn: t k
 rz | |  j } | j d ƒ | j | ƒ } n X| |  j } d } | | j |  j	 ƒ | j
 | ƒ | j
 |  j ƒ | j |  j ƒ | j | ƒ S(   Niÿÿÿÿ(   t   Encoderi   i    (   t   peachpy.encoderR   t
   isinstancet   AssertionErrort   fixed_stringR   t
   ValueErrort   uint32R   R   t   uint16R   t   uint8R   (	   R   t   encodert   name_index_mapt   section_index_mapR   t   name_8_bytest
   name_indext   section_indext   auxiliary_entries(    (    sJ   /torch/pytorch/third_party/python-peachpy/peachpy/formats/mscoff/symbol.pyt   encode_entry,   s     @(   R   R   t
   entry_sizeR   R$   (    (    (    sJ   /torch/pytorch/third_party/python-peachpy/peachpy/formats/mscoff/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 RS(   i    i   i   i
   i   i   i   i   i   i   i   i   i   i   i	   (   R   R   t   absolutet   x86_address32t   x86_imagebase_offset32t   x86_section_indext   x86_section_offset32t   x86_clr_tokent   x86_section_offset7t   x86_relocation_offset32t   x86_64_address64t   x86_64_address32t   x86_64_imagebase_offset32t   x86_64_relocation_offset32t!   x86_64_relocation_plus_1_offset32t!   x86_64_relocation_plus_2_offset32t!   x86_64_relocation_plus_3_offset32t!   x86_64_relocation_plus_4_offset32t!   x86_64_relocation_plus_5_offset32t   x86_64_section_indext   x86_64_section_offset32t   x86_64_section_offset7t   x86_64_clr_token(    (    (    sJ   /torch/pytorch/third_party/python-peachpy/peachpy/formats/mscoff/symbol.pyR&   ?   s*   t
   Relocationc           B   s#   e  Z d  Z d „  Z d d „ Z RS(   i
   c         C   sÉ   d d l  m } m } t | t ƒ s> t d t | ƒ ƒ ‚ n  | | ƒ sc t d t | ƒ ƒ ‚ n  | | ƒ s‚ t d | ƒ ‚ n  t | t ƒ sª t d t | ƒ ƒ ‚ n  | |  _	 | |  _
 | |  _ d  S(   Niÿÿÿÿ(   t   is_intt	   is_uint32s7   Relocation type %s is not in RelocationType enumerations   Offset %s is not an integers=   Offset %d can not be represented as a 32-bit unsigned integers+   Symbol %s is not an instance of Symbol type(   t   peachpy.utilR=   R>   R   R&   t	   TypeErrort   strR   R   t   typet   offsett   symbol(   R   RB   RC   RD   R=   R>   (    (    sJ   /torch/pytorch/third_party/python-peachpy/peachpy/formats/mscoff/symbol.pyR   q   s    		i    c         C   sz   d d  l  } t | | j j ƒ s' t ‚ |  j | k s< t ‚ | |  j } | j | |  j ƒ | j | ƒ | j |  j	 ƒ S(   Niÿÿÿÿ(
   R   R   R   R   R   RD   R   RC   R   RB   (   R   R   t   symbol_index_mapt   section_addresst   peachpyt   symbol_index(    (    sJ   /torch/pytorch/third_party/python-peachpy/peachpy/formats/mscoff/symbol.pyR$   €   s     (   R   R   R%   R   R$   (    (    (    sJ   /torch/pytorch/third_party/python-peachpy/peachpy/formats/mscoff/symbol.pyR<   n   s   	N(    (    (   t   enumR    R   R	   R   R&   R<   (    (    (    sJ   /torch/pytorch/third_party/python-peachpy/peachpy/formats/mscoff/symbol.pyt   <module>   s
   "/