MCPcopy Create free account
hub / github.com/ARMmbed/DAPLink / _find_sections

Function _find_sections

tools/flash_algo.py:185–198  ·  view source on GitHub ↗

Return a list of sections the same length and order of the input list

(elf, name_type_pairs)

Source from the content-addressed store, hash-verified

183
184
185def _find_sections(elf, name_type_pairs):
186 """Return a list of sections the same length and order of the input list"""
187 sections = [None] * len(name_type_pairs)
188 for section in elf.iter_sections():
189 section_name = section.name
190 section_type = section["sh_type"]
191 for i, name_and_type in enumerate(name_type_pairs):
192 if name_and_type != (section_name, section_type):
193 continue
194 if sections[i] is not None:
195 raise Exception("Elf contains duplicate section %s attr %s" %
196 (section_name, section_type))
197 sections[i] = section
198 return sections
199
200
201def _algo_fill_zi_if_missing(ro_rw_zi):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected