• Samuel Huang's avatar
    [SuperSize] Extend SuperSize-archive to embrace section ranges. · 626e421d
    Samuel Huang authored
    Previously SuperSize-archive focuses on section sizes and largely
    ignores section addresses. As a result, "** ELF Section" symbols all
    have address of 0. This CL refactors archive.py so that |section_range|
    (2-tuple of address and size) become a primary object of interest, and
    replaces widespread |section_size| usage. Details:
    * linker_map_parser.py: Changes to store and return section ranges.
      * Requires test output update.
    * archive.py: Extensive changes to use ranges throughout.
      * Add _ExtendSectionRange() helper.
      * _AddUnattributedSectionSymbols(): Add "** ELF Section" symbols in
        section name order, to make later sorting more predictable.
    * Not changed: CreateSectionSizesAndSymbols() params, to maintain
      .size format compatibility.
    
    "** ELF Section:" symbols can now have non-0 addresse (and better
    sort order). This required update of integration_test.py expected
    outputs.
    
    Other changes:
    * Add dbg.py to aid debugging (compatible with Python 3).
    
    Change-Id: Ife5a695a4d3d75a6c67dabae5de91c9bb9618100
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2099466Reviewed-by: default avatarSamuel Huang <huangs@chromium.org>
    Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
    Commit-Queue: Samuel Huang <huangs@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#749544}
    626e421d
archive.py 75.4 KB