File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ class ELFSection(typing.TypedDict):
102102 Info : int
103103 Relocations : list [dict [typing .Literal ["Relocation" ], ELFRelocation ]]
104104 SectionData : dict [typing .Literal ["Bytes" ], list [int ]]
105+ Size : int
105106 Symbols : list [dict [typing .Literal ["Symbol" ], _ELFSymbol ]]
106107 Type : dict [typing .Literal ["Name" ], str ]
107108
Original file line number Diff line number Diff line change @@ -390,7 +390,7 @@ def _handle_section(
390390 relocation = wrapped_relocation ["Relocation" ]
391391 hole = self ._handle_relocation (base , relocation , stencil .body )
392392 stencil .holes .append (hole )
393- elif section_type == "SHT_PROGBITS" :
393+ elif section_type in { "SHT_PROGBITS" , "SHT_NOBITS" } :
394394 if "SHF_ALLOC" not in flags :
395395 return
396396 if "SHF_EXECINSTR" in flags :
@@ -399,7 +399,11 @@ def _handle_section(
399399 else :
400400 value = _stencils .HoleValue .DATA
401401 stencil = group .data
402- section_data_bytes = section ["SectionData" ]["Bytes" ]
402+ if section_type == "SHT_PROGBITS" :
403+ section_data_bytes = section ["SectionData" ]["Bytes" ]
404+ else :
405+ # Zeroed BSS data:
406+ section_data_bytes = [0 ] * section ["Size" ]
403407 if "SHF_WRITE" in flags :
404408 assert value is _stencils .HoleValue .DATA
405409 value = _stencils .HoleValue .WRITABLE
You can’t perform that action at this time.
0 commit comments