Ë
    ÖùdQ  ã                   ó  — d dl mZ d dlmZmZmZ ddlmZ ddlm	Z	 ddl
mZ ddlZ G d	„ d
e«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ d e«      Z G d!„ d"e«      Z G d#„ d$e«      Z G d%„ d&e«      Z G d'„ d(e«      Z G d)„ d*e«      Z G d+„ d,e«      Z G d-„ d.e«      Z  G d/„ d0e«      Z! G d1„ d2e«      Z"y)3é   )ÚELFCompressionError)Ústruct_parseÚ
elf_assertÚparse_cstring_from_streamé    )Údefaultdicté   )ÚSH_FLAGS)Ú
iter_notesNc                   ód   — e Zd ZdZd„ Zed„ «       Zed„ «       Zed„ «       Zd„ Z	d„ Z
d„ Zd	„ Zd
„ Zy)ÚSectiona   Base class for ELF sections. Also used for all sections types that have
        no special functionality.

        Allows dictionary-like access to the section header. For example:
         > sec = Section(...)
         > sec['sh_type']  # section type
    c                 ó¬  — || _         || _        || _        | j                  j                  | _        | j                  j                  | _        |d   t
        j                  z  | _        | j                  rNt        | j                  j                  | j                  | d   ¬«      }|d   | _        |d   | _        |d   | _        y |d   | _        |d   | _        y )	NÚsh_flagsÚ	sh_offset©Ú
stream_posÚch_typeÚch_sizeÚch_addralignÚsh_sizeÚsh_addralign)ÚheaderÚnameÚelffileÚstreamÚstructsr
   ÚSHF_COMPRESSEDÚ_compressedÚ
compressedr   ÚElf_ChdrÚ_compression_typeÚ_decompressed_sizeÚ_decompressed_align)Úselfr   r   r   s       ú7/usr/lib/python3/dist-packages/elftools/elf/sections.pyÚ__init__zSection.__init__   sÃ   € ØˆŒØˆŒ	ØˆŒØ—l‘l×)Ñ)ˆŒØ—|‘|×+Ñ+ˆŒØ! *Ñ-´×0GÑ0GÑGˆÔà�?Š?ô " $§,¡,×"7Ñ"7Ø"&§+¡+Ø-1°+Ñ->ô@ˆFð &,¨IÑ%6ˆDÔ"Ø&,¨YÑ&7ˆDÔ#Ø'-¨nÑ'=ˆDÕ$à&,¨YÑ&7ˆDÔ#Ø'-¨nÑ'=ˆDÕ$ó    c                 ó   — | j                   S )z% Is this section compressed?
        )r   ©r$   s    r%   r   zSection.compressed/   s   € ð ×ÑÐr'   c                 ó   — | j                   S )z  Return the logical size for this section's data.

        This can be different from the .sh_size header field when the section
        is compressed.
        )r"   r)   s    r%   Ú	data_sizezSection.data_size5   s   € ð ×&Ñ&Ð&r'   c                 ó   — | j                   S )zª Return the logical alignment for this section's data.

        This can be different from the .sh_addralign header field when the
        section is compressed.
        )r#   r)   s    r%   Údata_alignmentzSection.data_alignment>   s   € ð ×'Ñ'Ð'r'   c                 óü  — | j                   d   dk(  rd| j                  z  S | j                  �r
| j                  }|dk(  r—| j                  j
                  j                  «       }| j                  j                  | d   |z   «       | j                  j                  | d   |z
  «      }t        j                  «       }|j                  || j                  «      }nt        dj                  |«      «      ‚t        |«      | j                   k7  r.t        dj                  t        |«      | j                   «      «      ‚|S | j                  j                  | d   «       | j                  j                  | j                   «      }|S )	zƒ The section data from the file.

        Note that data is decompressed if the stored section data is
        compressed.
        Úsh_typeÚ
SHT_NOBITSó    ÚELFCOMPRESS_ZLIBr   r   z Unknown compression type: {:#0x}z;Decompressed data is {} bytes long, should be {} bytes long)r   r+   r   r!   r   r    Úsizeofr   ÚseekÚreadÚzlibÚdecompressobjÚ
decompressr   ÚformatÚlenr"   )r$   Úc_typeÚhdr_sizer   ÚdecompÚresults         r%   ÚdatazSection.dataG   sN  € ð �;‰;�yÑ! \Ò1Ø˜Ÿ™Ñ'Ð'ð �?‹?Ø×+Ñ+ˆFØÐ+Ò+ð  Ÿ<™<×0Ñ0×7Ñ7Ó9�Ø—‘× Ñ   kÑ!2°XÑ!=Ô>Ø!Ÿ[™[×-Ñ-¨d°9©oÀÑ.HÓI�
ä×+Ñ+Ó-�Ø×*Ñ*¨:°t·~±~ÓF‘ä)Ø6×=Ñ=¸fÓEóð ô �6‹{˜d×5Ñ5Ò5Ü)ðß"™F¤3 v£;°×0GÑ0GÓHóð ð ˆð �K‰K×Ñ˜T +Ñ.Ô/Ø—[‘[×%Ñ% d×&=Ñ&=Ó>ˆFàˆr'   c                  ó   — y)z! Is this a null section?
        F© r)   s    r%   Úis_nullzSection.is_nullm   s   € ð r'   c                 ó    — | j                   |   S )z6 Implement dict-like access to header entries
        ©r   ©r$   r   s     r%   Ú__getitem__zSection.__getitem__r   ó   € ð �{‰{˜4Ñ Ð r'   c                 óT   — 	 | j                   |j                   k(  S # t        $ r Y yw xY w)NF)r   ÚAttributeError)r$   Úothers     r%   Ú__eq__zSection.__eq__w   s,   € ð	Ø—;‘; %§,¡,Ñ.Ð.øÜò 	Ùð	ús   ‚ ›	'¦'c                 ó,   — t        | j                  «      S ©N)Úhashr   r)   s    r%   Ú__hash__zSection.__hash__}   s   € Ü�D—K‘KÓ Ð r'   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r&   Úpropertyr   r+   r-   r?   rB   rF   rK   rO   rA   r'   r%   r   r      sb   „ ñò>ð* ñ ó ð ð
 ñ'ó ð'ð ñ(ó ð(ò$òLò
!ò
ó!r'   r   c                   ó   — e Zd ZdZd„ Zy)ÚNullSectionz ELF NULL section
    c                  ó   — y)NTrA   r)   s    r%   rB   zNullSection.is_null„   s   € Ør'   N)rP   rQ   rR   rS   rB   rA   r'   r%   rV   rV   �   s   „ ñór'   rV   c                   ó   — e Zd ZdZd„ Zy)ÚStringTableSectionz ELF string table section.
    c                 ól   — | d   }t        | j                  ||z   «      }|r|j                  dd¬«      S dS )zI Get the string stored at the given offset in this string table.
        r   úutf-8Úreplace)ÚerrorsÚ )r   r   Údecode)r$   ÚoffsetÚtable_offsetÚss       r%   Ú
get_stringzStringTableSection.get_string‹   s=   € ð ˜KÑ(ˆÜ% d§k¡k°<À&Ñ3HÓIˆÙ67ˆq�x‰x˜¨	ˆxÓ2Ð?¸RÐ?r'   N)rP   rQ   rR   rS   rc   rA   r'   r%   rY   rY   ˆ   s   „ ñó@r'   rY   c                   ó(   ‡ — e Zd ZdZˆ fd„Zd„ Zˆ xZS )ÚSymbolTableIndexSectionas   A section containing the section header table indices corresponding
        to symbols in the linked symbol table. This section has to exist if the
        symbol table contains an entry with a section header index set to
        SHN_XINDEX (0xffff). The format of the section is described at
        https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.sheader.html
    c                 ó>   •— t         t        | �  |||«       || _        y rM   )Úsuperre   r&   Úsymboltable©r$   r   r   r   rh   Ú	__class__s        €r%   r&   z SymbolTableIndexSection.__init__š   ó   ø€ ÜÔ% tÑ5°f¸dÀGÔLØ&ˆÕr'   c                 óŽ   — t        | j                  j                  j                  d«      | j                  | d   || d   z  z   «      S )zÕ Get the section header table index for the symbol with index #n.
            The section contains an array of Elf32_word values with one entry
            for every symbol in the associated symbol table.
        r^   r   Ú
sh_entsize)r   r   r   ÚElf_wordr   )r$   Úns     r%   Úget_section_indexz)SymbolTableIndexSection.get_section_indexž   sG   € ô
 ˜DŸL™L×0Ñ0×9Ñ9¸"Ó=¸t¿{¹{Ø  Ñ-°°D¸Ñ4FÑ0FÑFóHð 	Hr'   )rP   rQ   rR   rS   r&   rp   Ú__classcell__©rj   s   @r%   re   re   “   s   ø„ ñô'öHr'   re   c                   ó:   ‡ — e Zd ZdZˆ fd„Zd„ Zd„ Zd„ Zd„ Zˆ xZ	S )ÚSymbolTableSectionzn ELF symbol table section. Has an associated StringTableSection that's
        passed in the constructor.
    c                 ó¬   •— t         t        | �  |||«       || _        t	        | d   dkD  d|z  «       t	        | d   | d   z  dk(  d|z  «       d | _        y )Nrm   r   z+Expected entry size of section %r to be > 0r   zBExpected section size to be a multiple of entry size in section %r)rg   rt   r&   Ústringtabler   Ú_symbol_name_map)r$   r   r   r   rv   rj   s        €r%   r&   zSymbolTableSection.__init__«   sk   ø€ ÜÔ  $Ñ0°¸¸wÔGØ&ˆÔÜ�4˜Ñ%¨Ñ)Ø=ÀÑDô	Fä�4˜	‘? T¨,Ñ%7Ñ7¸1Ñ<ØTÐW[Ñ[ô	]à $ˆÕr'   c                 ó   — | d   | d   z  S )ú( Number of symbols in the table
        r   rm   rA   r)   s    r%   Únum_symbolszSymbolTableSection.num_symbols´   s   € ð �I‰ $ |Ñ"4Ñ4Ð4r'   c                 óÊ   — | d   || d   z  z   }t        | j                  j                  | j                  |¬«      }| j                  j                  |d   «      }t        ||«      S )zC Get the symbol at index #n from the table (Symbol object)
        r   rm   r   Úst_name)r   r   ÚElf_Symr   rv   rc   ÚSymbol©r$   ro   Úentry_offsetÚentryr   s        r%   Ú
get_symbolzSymbolTableSection.get_symbol¹   sh   € ð ˜KÑ(¨1¨t°LÑ/AÑ+AÑAˆÜØ�L‰L× Ñ Ø�K‰KØ#ô%ˆð
 ×Ñ×*Ñ*¨5°Ñ+;Ó<ˆÜ�e˜TÓ"Ð"r'   c                 óZ  — | j                   €]t        t        «      | _         t        | j	                  «       «      D ]-  \  }}| j                   |j
                     j                  |«       Œ/ | j                   j                  |«      }|r|D �cg c]  }| j                  |«      ‘Œ c}S dS c c}w )za Get a symbol(s) by name. Return None if no symbol by the given name
            exists.
        N)	rw   r   ÚlistÚ	enumerateÚiter_symbolsr   ÚappendÚgetr‚   )r$   r   ÚiÚsymÚsymnumss        r%   Úget_symbol_by_namez%SymbolTableSection.get_symbol_by_nameÆ   s•   € ð × Ñ Ð(Ü$/´Ó$5ˆDÔ!Ü# D×$5Ñ$5Ó$7Ó8ò :‘��3Ø×%Ñ% c§h¡hÑ/×6Ñ6°qÕ9ð:à×'Ñ'×+Ñ+¨DÓ1ˆÙ8?¨GÖ4 q�—‘ Õ"Ò4ÐIÀTÐIùÒ4s   ÂB(c              #   ón   K  — t        | j                  «       «      D ]  }| j                  |«      –— Œ y­w)ú, Yield all the symbols in the table
        N©Úrangerz   r‚   ©r$   r‰   s     r%   r†   zSymbolTableSection.iter_symbolsÔ   s4   è ø€ ô �t×'Ñ'Ó)Ó*ò 	%ˆAØ—/‘/ !Ó$Ó$ñ	%ùs   ‚35)
rP   rQ   rR   rS   r&   rz   r‚   rŒ   r†   rq   rr   s   @r%   rt   rt   §   s"   ø„ ñô%ò5ò
#òJö%r'   rt   c                   ó   — e Zd ZdZd„ Zd„ Zy)r~   z¿ Symbol object - representing a single symbol entry from a symbol table
        section.

        Similarly to Section objects, allows dictionary-like access to the
        symbol entry.
    c                 ó    — || _         || _        y rM   )r�   r   )r$   r�   r   s      r%   r&   zSymbol.__init__â   s   € ØˆŒ
Øˆ�	r'   c                 ó    — | j                   |   S )z/ Implement dict-like access to entries
        )r�   rE   s     r%   rF   zSymbol.__getitem__æ   s   € ð �z‰z˜$ÑÐr'   N)rP   rQ   rR   rS   r&   rF   rA   r'   r%   r~   r~   Û   s   „ ñòó r'   r~   c                   ó4   ‡ — e Zd ZdZˆ fd„Zd„ Zd„ Zd„ Zˆ xZS )ÚSUNWSyminfoTableSectionzu ELF .SUNW Syminfo table section.
        Has an associated SymbolTableSection that's passed in the constructor.
    c                 ó>   •— t         t        | �  |||«       || _        y rM   )rg   r–   r&   rh   ri   s        €r%   r&   z SUNWSyminfoTableSection.__init__ð   rk   r'   c                 ó   — | d   | d   z  dz
  S )ry   r   rm   r	   rA   r)   s    r%   rz   z#SUNWSyminfoTableSection.num_symbolsô   s   € ð �I‰ $ |Ñ"4Ñ4°qÑ8Ð8r'   c                 óØ   — | d   || d   z  z   }t        | j                  j                  | j                  |¬«      }| j                  j                  |«      j                  }t        ||«      S )zÆ Get the symbol at index #n from the table (Symbol object).
            It begins at 1 and not 0 since the first entry is used to
            store the current version of the syminfo table.
        r   rm   r   )r   r   ÚElf_Sunw_Syminfor   rh   r‚   r   r~   r   s        r%   r‚   z"SUNWSyminfoTableSection.get_symbolù   si   € ð ˜KÑ(¨1¨t°LÑ/AÑ+AÑAˆÜØ�L‰L×)Ñ)Ø�K‰KØ#ô%ˆð
 ×Ñ×*Ñ*¨1Ó-×2Ñ2ˆÜ�e˜TÓ"Ð"r'   c              #   óv   K  — t        d| j                  «       dz   «      D ]  }| j                  |«      –— Œ y­w)rŽ   r	   Nr�   r‘   s     r%   r†   z$SUNWSyminfoTableSection.iter_symbols  s;   è ø€ ô �q˜$×*Ñ*Ó,¨qÑ0Ó1ò 	%ˆAØ—/‘/ !Ó$Ó$ñ	%ùs   ‚79)	rP   rQ   rR   rS   r&   rz   r‚   r†   rq   rr   s   @r%   r–   r–   ì   s   ø„ ñô'ò9ò
#ö%r'   r–   c                   ó   — e Zd ZdZd„ Zy)ÚNoteSectionz1 ELF NOTE section. Knows how to parse notes.
    c                 ó<   — t        | j                  | d   | d   «      S )z­ Yield all the notes in the section.  Each result is a dictionary-
            like object with "n_name", "n_type", and "n_desc" fields, amongst
            others.
        r   r   )r   r   r)   s    r%   r   zNoteSection.iter_notes  s    € ô
 ˜$Ÿ,™,¨¨[Ñ(9¸4À	¹?ÓKÐKr'   N)rP   rQ   rR   rS   r   rA   r'   r%   r�   r�     s   „ ñóLr'   r�   c                   ó   — e Zd ZdZd„ Zy)ÚStabSectionz ELF stab section.
    c              #   ó0  K  — | d   }| d   }||z   }||k  r~t        | j                  j                  | j                  |¬«      }||d<   || j                  j                  j	                  «       z  }| j                  j                  |«       |–— ||k  rŒ}yy­w)zG Yield all stab entries.  Result type is ELFStructs.Elf_Stabs.
        r   r   r   Ún_offsetN)r   r   Ú	Elf_Stabsr   r3   r4   )r$   r`   ÚsizeÚendÚstabss        r%   Ú
iter_stabszStabSection.iter_stabs  s•   è ø€ ð �kÑ"ˆØ�I‰ˆØ�t‰mˆØ�sŠlÜ Ø—‘×&Ñ&Ø—‘Ø!ô#ˆEð !'ˆE�*ÑØ�d—l‘l×,Ñ,×3Ñ3Ó5Ñ5ˆFØ�K‰K×Ñ˜VÔ$ØŠKð �s�lùs   ‚BBÂBN)rP   rQ   rR   rS   r§   rA   r'   r%   r    r      s   „ ñór'   r    c                   ó,   — e Zd ZdZd„ Zed„ «       Zd„ Zy)Ú	AttributezE Attribute object - representing a build attribute of ELF files.
    c                 ó    — || _         d | _        y rM   )Ú_tagÚextra)r$   Útags     r%   r&   zAttribute.__init__0  s   € ØˆŒ	Øˆ�
r'   c                 ó    — | j                   d   S )Nr­   )r«   r)   s    r%   r­   zAttribute.tag4  s   € à�y‰y˜ÑÐr'   c                 ó¶   — d| j                   j                  ›d| j                  ›d| j                  ›d�}|| j                  �d| j                  z  z  }|S dz  }|S )Nú<z (z): ú>z %sr^   )rj   rP   r­   Úvaluer¬   ©r$   rb   s     r%   Ú__repr__zAttribute.__repr__8  sT   � à�^‰^×$Ó$ d§h£h°·
³
ð<ˆà	 4§:¡:Ð#9ˆU�T—Z‘ZÑÑAˆØˆð @BÑAˆØˆr'   N)rP   rQ   rR   rS   r&   rT   r­   r´   rA   r'   r%   r©   r©   -  s%   „ ñòð ñ ó ð ór'   r©   c                   óJ   — e Zd ZdZd„ Zd	d„Zed„ «       Zed„ «       Zd„ Z	d„ Z
y)
ÚAttributesSubsubsectionz= Subsubsection of an ELF attribute section's subsection.
    c                 óÐ   — || _         || _        || _        || _        | j                  | j                  | j                   «      | _        | j                   j                  «       | _        y rM   )r   r`   r   Ú	attributer   ÚtellÚ
attr_start)r$   r   r   r`   r¸   s        r%   r&   z AttributesSubsubsection.__init__B  sL   € ØˆŒØˆŒØˆŒØ"ˆŒà—n‘n T§\¡\°4·;±;Ó?ˆŒàŸ+™+×*Ñ*Ó,ˆ�r'   Nc              #   ób   K  — | j                  «       D ]  }|�|j                  |k(  sŒ|–— Œ y­w)z= Yield all attributes (limit to |tag| if specified).
        N)Ú_make_attributesr­   )r$   r­   r¸   s      r%   Úiter_attributesz'AttributesSubsubsection.iter_attributesL  s5   è ø€ ð ×.Ñ.Ó0ò 	 ˆIØˆ{˜iŸm™m¨sÓ2Ø“ñ	 ùs   ‚%/¨/c                 óH   — t        d„ | j                  «       D «       «      dz   S )z4 Number of attributes in the subsubsection.
        c              3   ó    K  — | ]  }d –— Œ y­w©r	   NrA   ©Ú.0Ú_s     r%   ú	<genexpr>z9AttributesSubsubsection.num_attributes.<locals>.<genexpr>W  s   è ø€ Ò5˜”1Ñ5ùó   ‚r	   )Úsumr½   r)   s    r%   Únum_attributesz&AttributesSubsubsection.num_attributesS  s#   € ô Ñ5˜d×2Ñ2Ó4Ô5Ó5¸Ñ9Ð9r'   c                 óP   — | j                   gt        | j                  «       «      z   S )z6 List of all attributes in the subsubsection.
        )r   r„   r½   r)   s    r%   Ú
attributesz"AttributesSubsubsection.attributesY  s#   € ð —‘ˆ}œt D×$8Ñ$8Ó$:Ó;Ñ;Ð;r'   c              #   ód  K  — | j                   | j                  j                  z   }| j                  j	                  | j
                  «       | j                  j                  «       |k7  rG| j                  | j                  | j                  «      –— | j                  j                  «       |k7  rŒFyy­w)zl Create all attributes for this subsubsection except the first one
            which is the header.
        N)	r`   r   r²   r   r4   rº   r¹   r¸   r   )r$   r¥   s     r%   r¼   z(AttributesSubsubsection._make_attributes_  s{   è ø€ ð �k‰k˜DŸK™K×-Ñ-Ñ-ˆà�‰×Ñ˜Ÿ™Ô)à�k‰k×ÑÓ  CÒ'Ø—.‘. §¡¨t¯{©{Ó;Ò;ð �k‰k×ÑÓ  CÕ'ùs   ‚B+B0Â.B0c                 ó”   — d}|| j                   j                  | j                  j                  dd  | j                  j                  fz  S )Nú<%s (%s): %d bytes>é   )rj   rP   r   r­   r²   r³   s     r%   r´   z AttributesSubsubsection.__repr__j  sC   € Ø!ˆØ�D—N‘N×+Ñ+Ø—K‘K—O‘O A BÐ'¨¯©×):Ñ):ð<ñ <ð 	<r'   rM   )rP   rQ   rR   rS   r&   r½   rT   rÇ   rÉ   r¼   r´   rA   r'   r%   r¶   r¶   ?  sC   „ ñò-ó ð ñ:ó ð:ð
 ñ<ó ð<ò
	<ó<r'   r¶   c                   óP   — e Zd ZdZd„ Zd
d„Zed„ «       Zed„ «       Zd„ Z	d„ Z
d	„ Zy)ÚAttributesSubsectionz. Subsection of an ELF attributes section.
    c                 óÆ   — || _         || _        || _        || _        t	        || j                   | j                  «      | _        | j                   j                  «       | _        y rM   )r   r`   r   Úsubsubsectionr   r   r¹   Úsubsubsec_start)r$   r   r   r`   r   rÑ   s         r%   r&   zAttributesSubsection.__init__s  sL   € ØˆŒØˆŒØˆŒØ*ˆÔä" 6¨4¯;©;¸¿¹ÓDˆŒà#Ÿ{™{×/Ñ/Ó1ˆÕr'   Nc              #   óv   K  — | j                  «       D ]"  }|�|j                  j                  |k(  sŒ|–— Œ$ y­w)zC Yield all subsubsections (limit to |scope| if specified).
        N)Ú_make_subsubsectionsr   r­   )r$   ÚscopeÚ	subsubsecs      r%   Úiter_subsubsectionsz(AttributesSubsection.iter_subsubsections}  s=   è ø€ ð ×2Ñ2Ó4ò 	 ˆIØˆ} 	× 0Ñ 0× 4Ñ 4¸Ó =Ø“ñ	 ùs   ‚/9²9c                 óB   — t        d„ | j                  «       D «       «      S )z5 Number of subsubsections in the subsection.
        c              3   ó    K  — | ]  }d –— Œ y­wrÀ   rA   rÁ   s     r%   rÄ   z:AttributesSubsection.num_subsubsections.<locals>.<genexpr>ˆ  s   è ø€ Ò9˜”1Ñ9ùrÅ   )rÆ   r×   r)   s    r%   Únum_subsubsectionsz'AttributesSubsection.num_subsubsections„  s   € ô Ñ9˜d×6Ñ6Ó8Ô9Ó9Ð9r'   c                 ó4   — t        | j                  «       «      S )z7 List of all subsubsections in the subsection.
        )r„   r×   r)   s    r%   Úsubsubsectionsz#AttributesSubsection.subsubsectionsŠ  s   € ô �D×,Ñ,Ó.Ó/Ð/r'   c              #   óð  K  — | j                   | d   z   }| j                  j                  | j                  «       | j                  j	                  «       |k7  rž| j                  | j                  | j                  | j                  j	                  «       «      }| j                  j                  | j                  |j                  j                  z   «       |–— | j                  j	                  «       |k7  rŒ�yy­w)z8 Create all subsubsections for this subsection.
        ÚlengthN)	r`   r   r4   rÒ   r¹   rÑ   r   r   r²   )r$   r¥   rÖ   s      r%   rÔ   z)AttributesSubsection._make_subsubsections�  s»   è ø€ ð �k‰k˜D ™NÑ*ˆà�‰×Ñ˜×-Ñ-Ô.à�k‰k×ÑÓ  CÒ'Ø×*Ñ*¨4¯;©;Ø+/¯<©<Ø+/¯;©;×+;Ñ+;Ó+=ó?ˆIð �K‰K×Ñ˜T×1Ñ1°I×4DÑ4D×4JÑ4JÑJÔKØŠOð �k‰k×ÑÓ  CÕ'ùs   ‚C1C6Ã4C6c                 ó    — | j                   |   S )z7 Implement dict-like access to header entries.
        rD   rE   s     r%   rF   z AttributesSubsection.__getitem__ž  rG   r'   c                 ór   — d}|| j                   j                  | j                  d   | j                  d   fz  S )NrÌ   Úvendor_namerÞ   )rj   rP   r   r³   s     r%   r´   zAttributesSubsection.__repr__£  s?   € Ø!ˆØ�T—^‘^×,Ñ,Ø—[‘[ Ñ/°·±¸XÑ1FðHñ Hð 	Hr'   rM   )rP   rQ   rR   rS   r&   r×   rT   rÚ   rÜ   rÔ   rF   r´   rA   r'   r%   rÏ   rÏ   p  sI   „ ñò2ó ð ñ:ó ð:ð
 ñ0ó ð0ò
ò!ó
Hr'   rÏ   c                   óP   ‡ — e Zd ZdZˆ fd„Zdd„Zed„ «       Zed„ «       Zd„ Z	ˆ xZ
S )ÚAttributesSectionz ELF attributes section.
    c                 ó*  •— t         t        | �  |||«       || _        t	        | j
                  j                  d«      | j                  | d   «      }t        t        |«      dk(  dt        |«      z  «       | j                  j                  «       | _        y )NÚformat_versionr   ÚAz-Unknown attributes version %s, expecting 'A'.)rg   rã   r&   Ú
subsectionr   r   ÚElf_byter   r   Úchrr¹   Úsubsec_start)r$   r   r   r   rç   Úfvrj   s         €r%   r&   zAttributesSection.__init__¬  s�   ø€ ÜÔ Ñ/°¸¸gÔFØ$ˆŒä˜$Ÿ,™,×/Ñ/Ð0@ÓAØŸ+™+Ø˜{Ñ+ó-ˆô 	”3�r“7˜c‘>ØBÄSÈÃWÑLô	Nð !ŸK™K×,Ñ,Ó.ˆÕr'   c              #   óT   K  — | j                  «       D ]  }|�	|d   |k(  sŒ|–— Œ y­w)zF Yield all subsections (limit to |vendor_name| if specified).
        Nrá   )Ú_make_subsections)r$   rá   Úsubsecs      r%   Úiter_subsectionsz"AttributesSection.iter_subsections¹  s7   è ø€ ð ×,Ñ,Ó.ò 	ˆFØÐ" f¨]Ñ&;¸{Ó&JØ“ñ	ùs   ‚(¡(c                 óB   — t        d„ | j                  «       D «       «      S )z/ Number of subsections in the section.
        c              3   ó    K  — | ]  }d –— Œ y­wrÀ   rA   rÁ   s     r%   rÄ   z4AttributesSection.num_subsections.<locals>.<genexpr>Ä  s   è ø€ Ò6˜”1Ñ6ùrÅ   )rÆ   rï   r)   s    r%   Únum_subsectionsz!AttributesSection.num_subsectionsÀ  s   € ô Ñ6˜d×3Ñ3Ó5Ô6Ó6Ð6r'   c                 ó4   — t        | j                  «       «      S )z1 List of all subsections in the section.
        )r„   rï   r)   s    r%   ÚsubsectionszAttributesSection.subsectionsÆ  s   € ô �D×)Ñ)Ó+Ó,Ð,r'   c              #   óÎ  K  — | d   | j                   z   }| j                  j                  | j                  «       | j                  j	                  «       |k7  r�| j                  | j                  | j                  | j                  j	                  «       «      }| j                  j                  | j                  |d   z   «       |–— | j                  j	                  «       |k7  rŒŒyy­w)z2 Create all subsections for this section.
        r   rÞ   N)r+   r   r4   rê   r¹   rç   r   )r$   r¥   rî   s      r%   rí   z#AttributesSection._make_subsectionsÌ  s³   è ø€ ð �;Ñ $§.¡.Ñ0ˆà�‰×Ñ˜×*Ñ*Ô+à�k‰k×ÑÓ  CÒ'Ø—_‘_ T§[¡[Ø%)§\¡\Ø%)§[¡[×%5Ñ%5Ó%7ó9ˆFð �K‰K×Ñ˜T×.Ñ.°¸Ñ1AÑAÔBØŠLð �k‰k×ÑÓ  CÕ'ùs   ‚C C%Ã#C%rM   )rP   rQ   rR   rS   r&   rï   rT   rò   rô   rí   rq   rr   s   @r%   rã   rã   ©  s?   ø„ ñô/óð ñ7ó ð7ð
 ñ-ó ð-ö
r'   rã   c                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )ÚARMAttributezM ARM attribute object - representing a build attribute of ARM ELF files.
    c                 óÈ  •— t         t        | �  t        |j                  |«      «       | j
                  dv r•t        |j                  d«      |«      | _        | j
                  dk7  reg | _        t        |j                  d«      |«      }|dk7  r=| j                  j                  |«       t        |j                  d«      |«      }|dk7  rŒ<y y y | j
                  dv r#t        |j                  dd¬«      |«      | _        y | j
                  d	k(  rCt        |j                  d«      |«      | _        t        |j                  d
d¬«      |«      | _        y | j
                  dk(  ret        ||«      | _        t        | j                  j                  «      t        ur.t        |j                  d«      |«      }t        |dk(  d|z  «       y y t        |j                  d«      |«      | _        y )N©ÚTAG_FILEÚTAG_SECTIONÚ
TAG_SYMBOLr²   rú   Ús_numberr   )ÚTAG_CPU_RAW_NAMEÚTAG_CPU_NAMEÚTAG_CONFORMANCEr[   ©ÚencodingÚTAG_COMPATIBILITYrá   ÚTAG_ALSO_COMPATIBLE_WITHÚnulz+Invalid terminating byte %r, expecting NUL.)rg   r÷   r&   r   ÚElf_Arm_Attribute_Tagr­   rn   r²   r¬   ÚElf_uleb128r‡   ÚElf_ntbsÚtypeÚstrrè   r   )r$   r   r   rý   r  rj   s        €r%   r&   zARMAttribute.__init__Þ  s½  ø€ ÜŒl˜DÑ*Ü˜×6Ñ6¸Ó?ô	Að �8‰8Ð@Ñ@Ü% g×&6Ñ&6°wÓ&?ÀÓHˆDŒJà�x‰x˜:Ò%Ø�”
Ü'¨×(;Ñ(;¸JÓ(GÈÓP�à !’mØ—J‘J×%Ñ% hÔ/Ü+¨G×,?Ñ,?À
Ó,KØ,2ó 4�Hð  !•mð	 &ð �X‰XÐPÑPÜ% g×&6Ñ&6°wØ@Gð '7ó 'Ià&,ó.ˆD�Jð �X‰XÐ,Ò,Ü% g×&9Ñ&9¸'Ó&BÀFÓKˆDŒJÜ% g×&6Ñ&6°}Ø@Gð '7ó 'Ià&,ó.ˆD�Jð �X‰XÐ3Ò3Ü% g¨vÓ6ˆDŒJä�D—J‘J×$Ñ$Ó%¬SÑ0Ü" 7×#3Ñ#3°EÓ#:¸FÓC�Ü˜3 !™8ØHÈ3ÑNõPð 1ô & g×&9Ñ&9¸'Ó&BÀFÓKˆD�Jr'   ©rP   rQ   rR   rS   r&   rq   rr   s   @r%   r÷   r÷   Û  s   ø„ ñ÷$Lð $Lr'   r÷   c                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )ÚARMAttributesSubsubsectionzC Subsubsection of an ELF .ARM.attributes section's subsection.
    c                 ó:   •— t         t        | �  |||t        «       y rM   )rg   r  r&   r÷   ©r$   r   r   r`   rj   s       €r%   r&   z#ARMAttributesSubsubsection.__init__  s   ø€ ÜÔ(¨$Ñ8Ø�G˜V¤\õ	3r'   r  rr   s   @r%   r  r    s   ø„ ñ÷3ð 3r'   r  c                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )ÚARMAttributesSubsectionz3 Subsection of an ELF .ARM.attributes section.
    c                 óP   •— t         t        | �  ||||j                  t        «       y rM   )rg   r  r&   ÚElf_Attr_Subsection_Headerr  r  s       €r%   r&   z ARMAttributesSubsection.__init__  s&   ø€ ÜÔ% tÑ5Ø�G˜VØ×.Ñ.Ü&õ	(r'   r  rr   s   @r%   r  r    s   ø„ ñ÷(ð (r'   r  c                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )ÚARMAttributesSectionz" ELF .ARM.attributes section.
    c                 ó:   •— t         t        | �  |||t        «       y rM   )rg   r  r&   r  ©r$   r   r   r   rj   s       €r%   r&   zARMAttributesSection.__init__  s   ø€ ÜÔ" DÑ2Ø�D˜'Ô#:õ	<r'   r  rr   s   @r%   r  r    s   ø„ ñ÷<ð <r'   r  c                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )ÚRISCVAttributez4 Attribute of an ELF .riscv.attributes section.
    c                 ó>  •— t         t        | �  t        |j                  |«      «       | j
                  dv r•t        |j                  d«      |«      | _        | j
                  dk7  reg | _        t        |j                  d«      |«      }|dk7  r=| j                  j                  |«       t        |j                  d«      |«      }|dk7  rŒ<y y y | j
                  dk(  r#t        |j                  dd¬«      |«      | _        y t        |j                  d«      |«      | _        y )	Nrù   r²   rú   rý   r   ÚTAG_ARCHr[   r  )rg   r  r&   r   ÚElf_RiscV_Attribute_Tagr­   rn   r²   r¬   r  r‡   r  )r$   r   r   rý   rj   s       €r%   r&   zRISCVAttribute.__init__"  s  ø€ ÜŒn˜dÑ,Ü˜×8Ñ8¸&ÓAô	Cð �8‰8Ð@Ñ@Ü% g×&6Ñ&6°wÓ&?ÀÓHˆDŒJà�x‰x˜:Ò%Ø�”
Ü'¨×(;Ñ(;¸JÓ(GÈÓP�à !’mØ—J‘J×%Ñ% hÔ/Ü+¨G×,?Ñ,?À
Ó,KØ,2ó 4�Hð  !•mð	 &ð �X‰X˜Ò#Ü% g×&6Ñ&6°wØ@Gð '7ó 'Ià&,ó.ˆD�Jô
 & g×&9Ñ&9¸'Ó&BÀFÓKˆD�Jr'   r  rr   s   @r%   r  r    s   ø„ ñ÷Lð Lr'   r  c                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )ÚRISCVAttributesSubsubsectionz; Subsubsection of an ELF .riscv.attributes subsection.
    c                 ó:   •— t         t        | �  |||t        «       y rM   )rg   r  r&   r  r  s       €r%   r&   z%RISCVAttributesSubsubsection.__init__>  s   ø€ ÜÔ*¨DÑ:Ø�G˜V¤^õ	5r'   r  rr   s   @r%   r  r  ;  s   ø„ ñ÷5ð 5r'   r  c                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )ÚRISCVAttributesSubsectionz5 Subsection of an ELF .riscv.attributes section.
    c                 óP   •— t         t        | �  ||||j                  t        «       y rM   )rg   r!  r&   r  r  r  s       €r%   r&   z"RISCVAttributesSubsection.__init__F  s&   ø€ ÜÔ'¨Ñ7Ø�G˜VØ×.Ñ.Ü(õ	*r'   r  rr   s   @r%   r!  r!  C  s   ø„ ñ÷*ð *r'   r!  c                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )ÚRISCVAttributesSectionz$ ELF .riscv.attributes section.
    c                 ó:   •— t         t        | �  |||t        «       y rM   )rg   r$  r&   r!  r  s       €r%   r&   zRISCVAttributesSection.__init__P  s   ø€ ÜÔ$ dÑ4Ø�D˜'Ô#<õ	>r'   r  rr   s   @r%   r$  r$  M  s   ø„ ñ÷>ð >r'   r$  )#Úcommon.exceptionsr   Úcommon.utilsr   r   r   Úcollectionsr   Ú	constantsr
   Únotesr   r6   Úobjectr   rV   rY   re   rt   r~   r–   r�   r    r©   r¶   rÏ   rã   r÷   r  r  r  r  r  r!  r$  rA   r'   r%   ú<module>r,     s3  ðõ 4ß NÑ NÝ #Ý Ý ã ôl!ˆfô l!ô^�'ô ô@˜ô @ôH˜gô Hô(1%˜ô 1%ôh ˆVô  ô" %˜gô  %ôFL�'ô Lô�'ô ô&�ô ô$.<˜gô .<ôb6H˜7ô 6Hôr/˜ô /ôd'L�9ô 'LôT3Ð!8ô 3ô(Ð2ô (ô<Ð,ô <ôL�Yô Lô85Ð#:ô 5ô*Ð 4ô *ô>Ð.õ >r'   