diff --git a/objdiff-core/src/obj/read.rs b/objdiff-core/src/obj/read.rs index b06feb36..88384783 100644 --- a/objdiff-core/src/obj/read.rs +++ b/objdiff-core/src/obj/read.rs @@ -208,6 +208,20 @@ fn map_symbols( .inspect(|sym| max_index = max_index.max(sym.index().0)) .collect::>(); obj_symbols.sort_by(|a, b| { + // First sort symbols by their section names lexicographically (for COFF section groups) + if let Some(a_section_index) = a.section_index() + && let Some(b_section_index) = b.section_index() + && let Ok(a_section) = obj_file.section_by_index(a_section_index) + && let Ok(b_section) = obj_file.section_by_index(b_section_index) + && let Ok(a_section_name) = a_section.name() + && let Ok(b_section_name) = b_section.name() + { + if a_section_name.contains('$') && !b_section_name.contains('$') { + return Ordering::Greater; + } else if !a_section_name.contains('$') && b_section_name.contains('$') { + return Ordering::Less; + } + } // Sort symbols by section index, placing absolute symbols last a.section_index() .map_or(usize::MAX, |s| s.0) @@ -956,9 +970,9 @@ fn do_combine_sections( let b_name = §ions[b].name; // .text$di < .text$mn < .text if a_name.contains('$') && !b_name.contains('$') { - return Ordering::Less; - } else if !a_name.contains('$') && b_name.contains('$') { return Ordering::Greater; + } else if !a_name.contains('$') && b_name.contains('$') { + return Ordering::Less; } a_name.cmp(b_name) }); diff --git a/objdiff-core/tests/snapshots/arch_ppc__read_vmx128_coff.snap b/objdiff-core/tests/snapshots/arch_ppc__read_vmx128_coff.snap index ca2cc874..6735844f 100644 --- a/objdiff-core/tests/snapshots/arch_ppc__read_vmx128_coff.snap +++ b/objdiff-core/tests/snapshots/arch_ppc__read_vmx128_coff.snap @@ -25,76 +25,6 @@ Object { align: None, virtual_address: None, }, - Symbol { - name: "[.debug$S]", - demangled_name: None, - normalized_name: None, - address: 0, - size: 3952, - kind: Section, - section: Some( - 1, - ), - flags: FlagSet(Local), - align: None, - virtual_address: None, - }, - Symbol { - name: "[.XBLD$W]", - demangled_name: None, - normalized_name: None, - address: 0, - size: 0, - kind: Section, - section: Some( - 2, - ), - flags: FlagSet(Local), - align: None, - virtual_address: None, - }, - Symbol { - name: "__C2_11886", - demangled_name: None, - normalized_name: None, - address: 0, - size: 16, - kind: Object, - section: Some( - 2, - ), - flags: FlagSet(Global | SizeInferred), - align: None, - virtual_address: None, - }, - Symbol { - name: "[.XBLD$W]", - demangled_name: None, - normalized_name: None, - address: 0, - size: 0, - kind: Section, - section: Some( - 3, - ), - flags: FlagSet(Local), - align: None, - virtual_address: None, - }, - Symbol { - name: "__C1_11886", - demangled_name: None, - normalized_name: None, - address: 0, - size: 16, - kind: Object, - section: Some( - 3, - ), - flags: FlagSet(Global | SizeInferred), - align: None, - virtual_address: None, - }, Symbol { name: "[.rdata]", demangled_name: None, @@ -1109,6 +1039,76 @@ Object { align: None, virtual_address: None, }, + Symbol { + name: "[.debug$S]", + demangled_name: None, + normalized_name: None, + address: 0, + size: 3952, + kind: Section, + section: Some( + 1, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.XBLD$W]", + demangled_name: None, + normalized_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 2, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "__C2_11886", + demangled_name: None, + normalized_name: None, + address: 0, + size: 16, + kind: Object, + section: Some( + 2, + ), + flags: FlagSet(Global | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.XBLD$W]", + demangled_name: None, + normalized_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 3, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "__C1_11886", + demangled_name: None, + normalized_name: None, + address: 0, + size: 16, + kind: Object, + section: Some( + 3, + ), + flags: FlagSet(Global | SizeInferred), + align: None, + virtual_address: None, + }, Symbol { name: "[.debug$S]", demangled_name: None, @@ -1335,7 +1335,7 @@ Object { 16, ), address: 92, - target_symbol: 7, + target_symbol: 2, addend: 0, }, Relocation { @@ -1343,7 +1343,7 @@ Object { 17, ), address: 96, - target_symbol: 7, + target_symbol: 2, addend: 0, }, Relocation { @@ -1359,7 +1359,7 @@ Object { 16, ), address: 132, - target_symbol: 67, + target_symbol: 62, addend: 0, }, Relocation { @@ -1367,7 +1367,7 @@ Object { 17, ), address: 136, - target_symbol: 67, + target_symbol: 62, addend: 0, }, Relocation { @@ -1375,7 +1375,7 @@ Object { 16, ), address: 144, - target_symbol: 65, + target_symbol: 60, addend: 0, }, Relocation { @@ -1383,7 +1383,7 @@ Object { 17, ), address: 148, - target_symbol: 65, + target_symbol: 60, addend: 0, }, Relocation { @@ -1391,7 +1391,7 @@ Object { 16, ), address: 156, - target_symbol: 63, + target_symbol: 58, addend: 0, }, Relocation { @@ -1399,7 +1399,7 @@ Object { 17, ), address: 160, - target_symbol: 63, + target_symbol: 58, addend: 0, }, Relocation { @@ -1407,7 +1407,7 @@ Object { 16, ), address: 168, - target_symbol: 61, + target_symbol: 56, addend: 0, }, Relocation { @@ -1415,7 +1415,7 @@ Object { 17, ), address: 172, - target_symbol: 61, + target_symbol: 56, addend: 0, }, Relocation { @@ -1423,7 +1423,7 @@ Object { 16, ), address: 180, - target_symbol: 59, + target_symbol: 54, addend: 0, }, Relocation { @@ -1431,7 +1431,7 @@ Object { 17, ), address: 184, - target_symbol: 59, + target_symbol: 54, addend: 0, }, Relocation { @@ -1439,7 +1439,7 @@ Object { 16, ), address: 192, - target_symbol: 57, + target_symbol: 52, addend: 0, }, Relocation { @@ -1447,7 +1447,7 @@ Object { 17, ), address: 196, - target_symbol: 57, + target_symbol: 52, addend: 0, }, Relocation { @@ -1455,7 +1455,7 @@ Object { 16, ), address: 204, - target_symbol: 55, + target_symbol: 50, addend: 0, }, Relocation { @@ -1463,7 +1463,7 @@ Object { 17, ), address: 208, - target_symbol: 55, + target_symbol: 50, addend: 0, }, Relocation { @@ -1471,7 +1471,7 @@ Object { 16, ), address: 216, - target_symbol: 53, + target_symbol: 48, addend: 0, }, Relocation { @@ -1479,7 +1479,7 @@ Object { 17, ), address: 220, - target_symbol: 53, + target_symbol: 48, addend: 0, }, Relocation { @@ -1487,7 +1487,7 @@ Object { 16, ), address: 228, - target_symbol: 51, + target_symbol: 46, addend: 0, }, Relocation { @@ -1495,7 +1495,7 @@ Object { 17, ), address: 232, - target_symbol: 51, + target_symbol: 46, addend: 0, }, Relocation { @@ -1503,7 +1503,7 @@ Object { 16, ), address: 240, - target_symbol: 51, + target_symbol: 46, addend: 0, }, Relocation { @@ -1511,7 +1511,7 @@ Object { 17, ), address: 244, - target_symbol: 51, + target_symbol: 46, addend: 0, }, Relocation { @@ -1519,7 +1519,7 @@ Object { 16, ), address: 252, - target_symbol: 51, + target_symbol: 46, addend: 0, }, Relocation { @@ -1527,7 +1527,7 @@ Object { 17, ), address: 256, - target_symbol: 51, + target_symbol: 46, addend: 0, }, Relocation { @@ -1535,7 +1535,7 @@ Object { 16, ), address: 264, - target_symbol: 51, + target_symbol: 46, addend: 0, }, Relocation { @@ -1543,7 +1543,7 @@ Object { 17, ), address: 268, - target_symbol: 51, + target_symbol: 46, addend: 0, }, Relocation { @@ -1551,7 +1551,7 @@ Object { 6, ), address: 284, - target_symbol: 33, + target_symbol: 28, addend: 0, }, Relocation { @@ -1559,7 +1559,7 @@ Object { 6, ), address: 320, - target_symbol: 33, + target_symbol: 28, addend: 0, }, Relocation { @@ -1567,7 +1567,7 @@ Object { 6, ), address: 356, - target_symbol: 33, + target_symbol: 28, addend: 0, }, Relocation { @@ -1575,7 +1575,7 @@ Object { 6, ), address: 496, - target_symbol: 34, + target_symbol: 29, addend: 0, }, Relocation { @@ -1583,7 +1583,7 @@ Object { 6, ), address: 516, - target_symbol: 34, + target_symbol: 29, addend: 0, }, Relocation { @@ -1591,7 +1591,7 @@ Object { 16, ), address: 520, - target_symbol: 8, + target_symbol: 3, addend: 0, }, Relocation { @@ -1599,7 +1599,7 @@ Object { 17, ), address: 524, - target_symbol: 8, + target_symbol: 3, addend: 0, }, Relocation { @@ -1615,7 +1615,7 @@ Object { 16, ), address: 540, - target_symbol: 9, + target_symbol: 4, addend: 0, }, Relocation { @@ -1623,7 +1623,7 @@ Object { 17, ), address: 544, - target_symbol: 9, + target_symbol: 4, addend: 0, }, Relocation { @@ -1631,7 +1631,7 @@ Object { 6, ), address: 548, - target_symbol: 27, + target_symbol: 22, addend: 0, }, Relocation { @@ -1639,7 +1639,7 @@ Object { 16, ), address: 560, - target_symbol: 10, + target_symbol: 5, addend: 0, }, Relocation { @@ -1647,7 +1647,7 @@ Object { 17, ), address: 564, - target_symbol: 10, + target_symbol: 5, addend: 0, }, Relocation { @@ -1655,7 +1655,7 @@ Object { 6, ), address: 568, - target_symbol: 27, + target_symbol: 22, addend: 0, }, Relocation { @@ -1663,7 +1663,7 @@ Object { 16, ), address: 580, - target_symbol: 11, + target_symbol: 6, addend: 0, }, Relocation { @@ -1671,7 +1671,7 @@ Object { 17, ), address: 584, - target_symbol: 11, + target_symbol: 6, addend: 0, }, Relocation { @@ -1679,7 +1679,7 @@ Object { 6, ), address: 588, - target_symbol: 27, + target_symbol: 22, addend: 0, }, Relocation { @@ -1687,7 +1687,7 @@ Object { 16, ), address: 600, - target_symbol: 12, + target_symbol: 7, addend: 0, }, Relocation { @@ -1695,7 +1695,7 @@ Object { 17, ), address: 604, - target_symbol: 12, + target_symbol: 7, addend: 0, }, Relocation { @@ -1703,7 +1703,7 @@ Object { 6, ), address: 608, - target_symbol: 27, + target_symbol: 22, addend: 0, }, Relocation { @@ -1711,7 +1711,7 @@ Object { 16, ), address: 612, - target_symbol: 13, + target_symbol: 8, addend: 0, }, Relocation { @@ -1719,7 +1719,7 @@ Object { 17, ), address: 616, - target_symbol: 13, + target_symbol: 8, addend: 0, }, Relocation { @@ -1735,7 +1735,7 @@ Object { 16, ), address: 716, - target_symbol: 79, + target_symbol: 74, addend: 0, }, Relocation { @@ -1743,7 +1743,7 @@ Object { 17, ), address: 720, - target_symbol: 79, + target_symbol: 74, addend: 0, }, Relocation { @@ -1751,7 +1751,7 @@ Object { 16, ), address: 728, - target_symbol: 77, + target_symbol: 72, addend: 0, }, Relocation { @@ -1759,7 +1759,7 @@ Object { 17, ), address: 732, - target_symbol: 77, + target_symbol: 72, addend: 0, }, Relocation { @@ -1767,7 +1767,7 @@ Object { 16, ), address: 740, - target_symbol: 75, + target_symbol: 70, addend: 0, }, Relocation { @@ -1775,7 +1775,7 @@ Object { 17, ), address: 744, - target_symbol: 75, + target_symbol: 70, addend: 0, }, Relocation { @@ -1783,7 +1783,7 @@ Object { 16, ), address: 752, - target_symbol: 73, + target_symbol: 68, addend: 0, }, Relocation { @@ -1791,7 +1791,7 @@ Object { 17, ), address: 756, - target_symbol: 73, + target_symbol: 68, addend: 0, }, Relocation { @@ -1799,7 +1799,7 @@ Object { 16, ), address: 764, - target_symbol: 67, + target_symbol: 62, addend: 0, }, Relocation { @@ -1807,7 +1807,7 @@ Object { 17, ), address: 768, - target_symbol: 67, + target_symbol: 62, addend: 0, }, Relocation { @@ -1815,7 +1815,7 @@ Object { 16, ), address: 776, - target_symbol: 71, + target_symbol: 66, addend: 0, }, Relocation { @@ -1823,7 +1823,7 @@ Object { 17, ), address: 780, - target_symbol: 71, + target_symbol: 66, addend: 0, }, Relocation { @@ -1831,7 +1831,7 @@ Object { 16, ), address: 788, - target_symbol: 69, + target_symbol: 64, addend: 0, }, Relocation { @@ -1839,7 +1839,7 @@ Object { 17, ), address: 792, - target_symbol: 69, + target_symbol: 64, addend: 0, }, Relocation { @@ -1847,7 +1847,7 @@ Object { 16, ), address: 800, - target_symbol: 73, + target_symbol: 68, addend: 0, }, Relocation { @@ -1855,7 +1855,7 @@ Object { 17, ), address: 804, - target_symbol: 73, + target_symbol: 68, addend: 0, }, Relocation { @@ -1863,7 +1863,7 @@ Object { 6, ), address: 948, - target_symbol: 33, + target_symbol: 28, addend: 0, }, Relocation { @@ -1871,7 +1871,7 @@ Object { 6, ), address: 984, - target_symbol: 33, + target_symbol: 28, addend: 0, }, Relocation { @@ -1879,7 +1879,7 @@ Object { 6, ), address: 1020, - target_symbol: 33, + target_symbol: 28, addend: 0, }, Relocation { @@ -1887,7 +1887,7 @@ Object { 16, ), address: 1196, - target_symbol: 14, + target_symbol: 9, addend: 0, }, Relocation { @@ -1895,7 +1895,7 @@ Object { 17, ), address: 1200, - target_symbol: 14, + target_symbol: 9, addend: 0, }, Relocation { @@ -1911,7 +1911,7 @@ Object { 16, ), address: 1216, - target_symbol: 15, + target_symbol: 10, addend: 0, }, Relocation { @@ -1919,7 +1919,7 @@ Object { 17, ), address: 1220, - target_symbol: 15, + target_symbol: 10, addend: 0, }, Relocation { @@ -1927,7 +1927,7 @@ Object { 6, ), address: 1224, - target_symbol: 27, + target_symbol: 22, addend: 0, }, Relocation { @@ -1935,7 +1935,7 @@ Object { 16, ), address: 1236, - target_symbol: 16, + target_symbol: 11, addend: 0, }, Relocation { @@ -1943,7 +1943,7 @@ Object { 17, ), address: 1240, - target_symbol: 16, + target_symbol: 11, addend: 0, }, Relocation { @@ -1951,7 +1951,7 @@ Object { 6, ), address: 1244, - target_symbol: 27, + target_symbol: 22, addend: 0, }, Relocation { @@ -1959,7 +1959,7 @@ Object { 16, ), address: 1256, - target_symbol: 17, + target_symbol: 12, addend: 0, }, Relocation { @@ -1967,7 +1967,7 @@ Object { 17, ), address: 1260, - target_symbol: 17, + target_symbol: 12, addend: 0, }, Relocation { @@ -1975,7 +1975,7 @@ Object { 6, ), address: 1264, - target_symbol: 27, + target_symbol: 22, addend: 0, }, Relocation { @@ -1983,7 +1983,7 @@ Object { 16, ), address: 1276, - target_symbol: 18, + target_symbol: 13, addend: 0, }, Relocation { @@ -1991,7 +1991,7 @@ Object { 17, ), address: 1280, - target_symbol: 18, + target_symbol: 13, addend: 0, }, Relocation { @@ -1999,7 +1999,7 @@ Object { 6, ), address: 1284, - target_symbol: 27, + target_symbol: 22, addend: 0, }, Relocation { @@ -2007,7 +2007,7 @@ Object { 16, ), address: 1296, - target_symbol: 19, + target_symbol: 14, addend: 0, }, Relocation { @@ -2015,7 +2015,7 @@ Object { 17, ), address: 1300, - target_symbol: 19, + target_symbol: 14, addend: 0, }, Relocation { @@ -2023,7 +2023,7 @@ Object { 6, ), address: 1304, - target_symbol: 27, + target_symbol: 22, addend: 0, }, Relocation { @@ -2031,7 +2031,7 @@ Object { 16, ), address: 1308, - target_symbol: 20, + target_symbol: 15, addend: 0, }, Relocation { @@ -2039,7 +2039,7 @@ Object { 17, ), address: 1312, - target_symbol: 20, + target_symbol: 15, addend: 0, }, Relocation { @@ -2055,7 +2055,7 @@ Object { 16, ), address: 1548, - target_symbol: 21, + target_symbol: 16, addend: 0, }, Relocation { @@ -2063,7 +2063,7 @@ Object { 17, ), address: 1552, - target_symbol: 21, + target_symbol: 16, addend: 0, }, Relocation { @@ -2079,7 +2079,7 @@ Object { 16, ), address: 1568, - target_symbol: 22, + target_symbol: 17, addend: 0, }, Relocation { @@ -2087,7 +2087,7 @@ Object { 17, ), address: 1572, - target_symbol: 22, + target_symbol: 17, addend: 0, }, Relocation { @@ -2095,7 +2095,7 @@ Object { 6, ), address: 1576, - target_symbol: 27, + target_symbol: 22, addend: 0, }, Relocation { @@ -2103,7 +2103,7 @@ Object { 16, ), address: 1580, - target_symbol: 23, + target_symbol: 18, addend: 0, }, Relocation { @@ -2111,7 +2111,7 @@ Object { 17, ), address: 1584, - target_symbol: 23, + target_symbol: 18, addend: 0, }, Relocation { @@ -2127,7 +2127,7 @@ Object { 16, ), address: 1620, - target_symbol: 24, + target_symbol: 19, addend: 0, }, Relocation { @@ -2135,7 +2135,7 @@ Object { 17, ), address: 1624, - target_symbol: 24, + target_symbol: 19, addend: 0, }, Relocation { @@ -2151,7 +2151,7 @@ Object { 6, ), address: 1632, - target_symbol: 30, + target_symbol: 25, addend: 0, }, Relocation { @@ -2159,7 +2159,7 @@ Object { 6, ), address: 1636, - target_symbol: 35, + target_symbol: 30, addend: 0, }, Relocation { @@ -2167,7 +2167,7 @@ Object { 6, ), address: 1640, - target_symbol: 38, + target_symbol: 33, addend: 0, }, Relocation { @@ -2175,7 +2175,7 @@ Object { 16, ), address: 1644, - target_symbol: 25, + target_symbol: 20, addend: 0, }, Relocation { @@ -2183,7 +2183,7 @@ Object { 17, ), address: 1648, - target_symbol: 25, + target_symbol: 20, addend: 0, }, Relocation { @@ -2217,7 +2217,7 @@ Object { 2, ), address: 0, - target_symbol: 27, + target_symbol: 22, addend: 0, }, Relocation { @@ -2225,7 +2225,7 @@ Object { 2, ), address: 8, - target_symbol: 30, + target_symbol: 25, addend: 0, }, Relocation { @@ -2233,7 +2233,7 @@ Object { 2, ), address: 16, - target_symbol: 35, + target_symbol: 30, addend: 0, }, Relocation { @@ -2241,7 +2241,7 @@ Object { 2, ), address: 24, - target_symbol: 38, + target_symbol: 33, addend: 0, }, Relocation { @@ -2249,7 +2249,7 @@ Object { 2, ), address: 32, - target_symbol: 41, + target_symbol: 36, addend: 0, }, ], diff --git a/objdiff-core/tests/snapshots/arch_x86__display_section_ordering.snap b/objdiff-core/tests/snapshots/arch_x86__display_section_ordering.snap index d6747677..05de2223 100644 --- a/objdiff-core/tests/snapshots/arch_x86__display_section_ordering.snap +++ b/objdiff-core/tests/snapshots/arch_x86__display_section_ordering.snap @@ -10,7 +10,7 @@ expression: section_display match_percent: None, symbols: [ SectionDisplaySymbol { - symbol: 2, + symbol: 1, is_mapping_symbol: false, }, ], @@ -23,7 +23,7 @@ expression: section_display match_percent: None, symbols: [ SectionDisplaySymbol { - symbol: 4, + symbol: 3, is_mapping_symbol: false, }, ], @@ -36,7 +36,7 @@ expression: section_display match_percent: None, symbols: [ SectionDisplaySymbol { - symbol: 6, + symbol: 5, is_mapping_symbol: false, }, ], @@ -49,7 +49,7 @@ expression: section_display match_percent: None, symbols: [ SectionDisplaySymbol { - symbol: 8, + symbol: 7, is_mapping_symbol: false, }, ], @@ -62,7 +62,7 @@ expression: section_display match_percent: None, symbols: [ SectionDisplaySymbol { - symbol: 10, + symbol: 9, is_mapping_symbol: false, }, ], @@ -75,7 +75,7 @@ expression: section_display match_percent: None, symbols: [ SectionDisplaySymbol { - symbol: 12, + symbol: 11, is_mapping_symbol: false, }, ], @@ -88,7 +88,7 @@ expression: section_display match_percent: None, symbols: [ SectionDisplaySymbol { - symbol: 14, + symbol: 13, is_mapping_symbol: false, }, ], @@ -101,7 +101,7 @@ expression: section_display match_percent: None, symbols: [ SectionDisplaySymbol { - symbol: 16, + symbol: 15, is_mapping_symbol: false, }, ], @@ -114,7 +114,7 @@ expression: section_display match_percent: None, symbols: [ SectionDisplaySymbol { - symbol: 18, + symbol: 17, is_mapping_symbol: false, }, ], @@ -127,7 +127,7 @@ expression: section_display match_percent: None, symbols: [ SectionDisplaySymbol { - symbol: 20, + symbol: 19, is_mapping_symbol: false, }, ], @@ -140,7 +140,7 @@ expression: section_display match_percent: None, symbols: [ SectionDisplaySymbol { - symbol: 22, + symbol: 21, is_mapping_symbol: false, }, ], @@ -153,7 +153,7 @@ expression: section_display match_percent: None, symbols: [ SectionDisplaySymbol { - symbol: 24, + symbol: 23, is_mapping_symbol: false, }, ], @@ -166,7 +166,7 @@ expression: section_display match_percent: None, symbols: [ SectionDisplaySymbol { - symbol: 26, + symbol: 25, is_mapping_symbol: false, }, ], @@ -179,7 +179,7 @@ expression: section_display match_percent: None, symbols: [ SectionDisplaySymbol { - symbol: 28, + symbol: 27, is_mapping_symbol: false, }, ], @@ -192,7 +192,7 @@ expression: section_display match_percent: None, symbols: [ SectionDisplaySymbol { - symbol: 30, + symbol: 29, is_mapping_symbol: false, }, ], @@ -205,7 +205,7 @@ expression: section_display match_percent: None, symbols: [ SectionDisplaySymbol { - symbol: 32, + symbol: 31, is_mapping_symbol: false, }, ], @@ -218,7 +218,7 @@ expression: section_display match_percent: None, symbols: [ SectionDisplaySymbol { - symbol: 34, + symbol: 33, is_mapping_symbol: false, }, ], diff --git a/objdiff-core/tests/snapshots/arch_x86__read_x86_64.snap b/objdiff-core/tests/snapshots/arch_x86__read_x86_64.snap index 726a7ec7..0594551c 100644 --- a/objdiff-core/tests/snapshots/arch_x86__read_x86_64.snap +++ b/objdiff-core/tests/snapshots/arch_x86__read_x86_64.snap @@ -24,290 +24,318 @@ Object { virtual_address: None, }, Symbol { - name: "[.debug$S]", + name: "[.xdata]", demangled_name: None, normalized_name: None, address: 0, - size: 156, + size: 0, kind: Section, section: Some( - 1, + 7, ), flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "[.text$mn]", + name: "$unwind$?Dot@Vector@@QEAAMPEAU1@@Z", demangled_name: None, normalized_name: None, address: 0, - size: 0, - kind: Section, + size: 8, + kind: Object, section: Some( - 2, + 7, ), - flags: FlagSet(Local), + flags: FlagSet(Local | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z", - demangled_name: Some( - "bool __cdecl Tools_CapsuleTestMagSq(struct Vector *, struct Vector *, struct Vector *, float)", - ), + name: "[.pdata]", + demangled_name: None, normalized_name: None, address: 0, - size: 429, - kind: Function, + size: 0, + kind: Section, section: Some( - 2, + 8, ), - flags: FlagSet(Global | SizeInferred), + flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "$LN8", + name: "$pdata$?Dot@Vector@@QEAAMPEAU1@@Z", demangled_name: None, normalized_name: None, address: 0, - size: 0, - kind: Unknown, + size: 12, + kind: Object, section: Some( - 2, + 8, ), - flags: FlagSet(Local), + flags: FlagSet(Local | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "[.text$mn]", + name: "[.xdata]", demangled_name: None, normalized_name: None, address: 0, size: 0, kind: Section, section: Some( - 3, + 9, ), flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "?DistSq@Vector@@QEAAMPEAU1@@Z", - demangled_name: Some( - "public: float __cdecl Vector::DistSq(struct Vector *)", - ), + name: "$unwind$?DistSq@Vector@@QEAAMPEAU1@@Z", + demangled_name: None, normalized_name: None, address: 0, - size: 141, - kind: Function, + size: 8, + kind: Object, section: Some( - 3, + 9, ), - flags: FlagSet(Global | SizeInferred), + flags: FlagSet(Local | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "$LN3", + name: "[.pdata]", demangled_name: None, normalized_name: None, address: 0, size: 0, - kind: Unknown, + kind: Section, section: Some( - 3, + 10, ), flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "[.text$mn]", + name: "$pdata$?DistSq@Vector@@QEAAMPEAU1@@Z", demangled_name: None, normalized_name: None, address: 0, - size: 0, - kind: Section, + size: 12, + kind: Object, section: Some( - 4, + 10, ), - flags: FlagSet(Local), + flags: FlagSet(Local | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "?Dot@Vector@@QEAAMPEAU1@@Z", - demangled_name: Some( - "public: float __cdecl Vector::Dot(struct Vector *)", - ), + name: "[.xdata]", + demangled_name: None, normalized_name: None, address: 0, - size: 87, - kind: Function, + size: 0, + kind: Section, section: Some( - 4, + 11, ), - flags: FlagSet(Global | SizeInferred), + flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "$LN3", + name: "$unwind$?Sub@Vector@@QEAAXPEAU1@0@Z", demangled_name: None, normalized_name: None, address: 0, - size: 0, - kind: Unknown, + size: 8, + kind: Object, section: Some( - 4, + 11, ), - flags: FlagSet(Local), + flags: FlagSet(Local | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "[.text$mn]", + name: "[.pdata]", demangled_name: None, normalized_name: None, address: 0, size: 0, kind: Section, section: Some( - 5, + 12, ), flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "?Sub@Vector@@QEAAXPEAU1@0@Z", - demangled_name: Some( - "public: void __cdecl Vector::Sub(struct Vector *, struct Vector *)", - ), + name: "$pdata$?Sub@Vector@@QEAAXPEAU1@0@Z", + demangled_name: None, normalized_name: None, address: 0, - size: 105, - kind: Function, + size: 12, + kind: Object, section: Some( - 5, + 12, ), - flags: FlagSet(Global | SizeInferred), + flags: FlagSet(Local | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "$LN3", + name: "[.xdata]", demangled_name: None, normalized_name: None, address: 0, size: 0, - kind: Unknown, + kind: Section, section: Some( - 5, + 13, ), flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "[.text$mn]", + name: "$unwind$?Vector_MagSquared@@YAMPEAUVector@@@Z", demangled_name: None, normalized_name: None, address: 0, - size: 0, - kind: Section, + size: 8, + kind: Object, section: Some( - 6, + 13, ), - flags: FlagSet(Local), + flags: FlagSet(Local | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "?Vector_MagSquared@@YAMPEAUVector@@@Z", - demangled_name: Some( - "float __cdecl Vector_MagSquared(struct Vector *)", - ), + name: "[.pdata]", + demangled_name: None, normalized_name: None, address: 0, - size: 82, - kind: Function, + size: 0, + kind: Section, section: Some( - 6, + 14, ), - flags: FlagSet(Global | SizeInferred), + flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "$LN3", + name: "$pdata$?Vector_MagSquared@@YAMPEAUVector@@@Z", demangled_name: None, normalized_name: None, address: 0, - size: 0, - kind: Unknown, + size: 12, + kind: Object, section: Some( - 6, + 14, ), - flags: FlagSet(Local), + flags: FlagSet(Local | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "[.xdata]", + name: "[.rdata]", demangled_name: None, normalized_name: None, address: 0, size: 0, kind: Section, section: Some( - 7, + 15, ), flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "$unwind$?Dot@Vector@@QEAAMPEAU1@@Z", - demangled_name: None, + name: "?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z$rtcName$0", + demangled_name: Some( + "bool __cdecl Tools_CapsuleTestMagSq(struct Vector *, struct Vector *, struct Vector *, float)", + ), normalized_name: None, address: 0, - size: 8, + size: 16, kind: Object, section: Some( - 7, + 15, ), flags: FlagSet(Local | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "[.pdata]", - demangled_name: None, + name: "?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z$rtcName$1", + demangled_name: Some( + "bool __cdecl Tools_CapsuleTestMagSq(struct Vector *, struct Vector *, struct Vector *, float)", + ), normalized_name: None, - address: 0, - size: 0, - kind: Section, + address: 16, + size: 12, + kind: Object, section: Some( - 8, + 15, ), - flags: FlagSet(Local), + flags: FlagSet(Local | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "$pdata$?Dot@Vector@@QEAAMPEAU1@@Z", - demangled_name: None, + name: "?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z$rtcName$2", + demangled_name: Some( + "bool __cdecl Tools_CapsuleTestMagSq(struct Vector *, struct Vector *, struct Vector *, float)", + ), normalized_name: None, - address: 0, - size: 12, + address: 28, + size: 20, kind: Object, section: Some( - 8, + 15, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z$rtcVarDesc", + demangled_name: Some( + "bool __cdecl Tools_CapsuleTestMagSq(struct Vector *, struct Vector *, struct Vector *, float)", + ), + normalized_name: None, + address: 48, + size: 192, + kind: Object, + section: Some( + 15, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z$rtcFrameData", + demangled_name: Some( + "bool __cdecl Tools_CapsuleTestMagSq(struct Vector *, struct Vector *, struct Vector *, float)", + ), + normalized_name: None, + address: 240, + size: 16, + kind: Object, + section: Some( + 15, ), flags: FlagSet(Local | SizeInferred), align: None, @@ -321,21 +349,21 @@ Object { size: 0, kind: Section, section: Some( - 9, + 16, ), flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "$unwind$?DistSq@Vector@@QEAAMPEAU1@@Z", + name: "$unwind$?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z", demangled_name: None, normalized_name: None, address: 0, - size: 8, + size: 20, kind: Object, section: Some( - 9, + 16, ), flags: FlagSet(Local | SizeInferred), align: None, @@ -349,439 +377,411 @@ Object { size: 0, kind: Section, section: Some( - 10, + 17, ), flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "$pdata$?DistSq@Vector@@QEAAMPEAU1@@Z", + name: "$pdata$?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z", demangled_name: None, normalized_name: None, address: 0, size: 12, kind: Object, section: Some( - 10, + 17, ), flags: FlagSet(Local | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "[.xdata]", + name: "[.voltbl]", demangled_name: None, normalized_name: None, address: 0, size: 0, kind: Section, section: Some( - 11, + 18, ), flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "$unwind$?Sub@Vector@@QEAAXPEAU1@0@Z", + name: "_volmd", demangled_name: None, normalized_name: None, address: 0, - size: 8, + size: 16, kind: Object, section: Some( - 11, + 18, ), flags: FlagSet(Local | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "[.pdata]", + name: "[.rdata]", demangled_name: None, normalized_name: None, address: 0, size: 0, kind: Section, section: Some( - 12, + 21, ), flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "$pdata$?Sub@Vector@@QEAAXPEAU1@0@Z", + name: "__real@00000000", demangled_name: None, normalized_name: None, address: 0, - size: 12, + size: 4, kind: Object, section: Some( - 12, + 21, ), - flags: FlagSet(Local | SizeInferred), + flags: FlagSet(Global | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "[.xdata]", + name: "[.rdata]", demangled_name: None, normalized_name: None, address: 0, size: 0, kind: Section, section: Some( - 13, + 22, ), flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "$unwind$?Vector_MagSquared@@YAMPEAUVector@@@Z", + name: "__real@3f800000", demangled_name: None, normalized_name: None, address: 0, - size: 8, + size: 4, kind: Object, section: Some( - 13, + 22, ), - flags: FlagSet(Local | SizeInferred), + flags: FlagSet(Global | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "[.pdata]", + name: "[.chks64]", demangled_name: None, normalized_name: None, address: 0, - size: 0, + size: 192, kind: Section, section: Some( - 14, + 23, ), flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "$pdata$?Vector_MagSquared@@YAMPEAUVector@@@Z", + name: "[.debug$S]", demangled_name: None, normalized_name: None, address: 0, - size: 12, - kind: Object, + size: 156, + kind: Section, section: Some( - 14, + 1, ), - flags: FlagSet(Local | SizeInferred), + flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "[.rdata]", + name: "[.text$mn]", demangled_name: None, normalized_name: None, address: 0, size: 0, kind: Section, section: Some( - 15, + 2, ), flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z$rtcName$0", + name: "?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z", demangled_name: Some( "bool __cdecl Tools_CapsuleTestMagSq(struct Vector *, struct Vector *, struct Vector *, float)", ), normalized_name: None, address: 0, - size: 16, - kind: Object, + size: 429, + kind: Function, section: Some( - 15, + 2, ), - flags: FlagSet(Local | SizeInferred), + flags: FlagSet(Global | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z$rtcName$1", - demangled_name: Some( - "bool __cdecl Tools_CapsuleTestMagSq(struct Vector *, struct Vector *, struct Vector *, float)", - ), + name: "$LN8", + demangled_name: None, normalized_name: None, - address: 16, - size: 12, - kind: Object, + address: 0, + size: 0, + kind: Unknown, section: Some( - 15, + 2, ), - flags: FlagSet(Local | SizeInferred), + flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z$rtcName$2", - demangled_name: Some( - "bool __cdecl Tools_CapsuleTestMagSq(struct Vector *, struct Vector *, struct Vector *, float)", - ), + name: "[.text$mn]", + demangled_name: None, normalized_name: None, - address: 28, - size: 20, - kind: Object, + address: 0, + size: 0, + kind: Section, section: Some( - 15, + 3, ), - flags: FlagSet(Local | SizeInferred), + flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z$rtcVarDesc", + name: "?DistSq@Vector@@QEAAMPEAU1@@Z", demangled_name: Some( - "bool __cdecl Tools_CapsuleTestMagSq(struct Vector *, struct Vector *, struct Vector *, float)", + "public: float __cdecl Vector::DistSq(struct Vector *)", ), normalized_name: None, - address: 48, - size: 192, - kind: Object, + address: 0, + size: 141, + kind: Function, section: Some( - 15, + 3, ), - flags: FlagSet(Local | SizeInferred), + flags: FlagSet(Global | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z$rtcFrameData", - demangled_name: Some( - "bool __cdecl Tools_CapsuleTestMagSq(struct Vector *, struct Vector *, struct Vector *, float)", - ), + name: "$LN3", + demangled_name: None, normalized_name: None, - address: 240, - size: 16, - kind: Object, + address: 0, + size: 0, + kind: Unknown, section: Some( - 15, + 3, ), - flags: FlagSet(Local | SizeInferred), + flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "[.xdata]", + name: "[.text$mn]", demangled_name: None, normalized_name: None, address: 0, size: 0, kind: Section, section: Some( - 16, + 4, ), flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "$unwind$?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z", - demangled_name: None, + name: "?Dot@Vector@@QEAAMPEAU1@@Z", + demangled_name: Some( + "public: float __cdecl Vector::Dot(struct Vector *)", + ), normalized_name: None, address: 0, - size: 20, - kind: Object, + size: 87, + kind: Function, section: Some( - 16, + 4, ), - flags: FlagSet(Local | SizeInferred), + flags: FlagSet(Global | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "[.pdata]", + name: "$LN3", demangled_name: None, normalized_name: None, address: 0, size: 0, - kind: Section, + kind: Unknown, section: Some( - 17, + 4, ), flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "$pdata$?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z", - demangled_name: None, - normalized_name: None, - address: 0, - size: 12, - kind: Object, - section: Some( - 17, - ), - flags: FlagSet(Local | SizeInferred), - align: None, - virtual_address: None, - }, - Symbol { - name: "[.voltbl]", + name: "[.text$mn]", demangled_name: None, normalized_name: None, address: 0, size: 0, kind: Section, section: Some( - 18, + 5, ), flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "_volmd", - demangled_name: None, + name: "?Sub@Vector@@QEAAXPEAU1@0@Z", + demangled_name: Some( + "public: void __cdecl Vector::Sub(struct Vector *, struct Vector *)", + ), normalized_name: None, address: 0, - size: 16, - kind: Object, + size: 105, + kind: Function, section: Some( - 18, + 5, ), - flags: FlagSet(Local | SizeInferred), + flags: FlagSet(Global | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "[.rtc$IMZ]", + name: "$LN3", demangled_name: None, normalized_name: None, address: 0, size: 0, - kind: Section, + kind: Unknown, section: Some( - 19, + 5, ), flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "_RTC_InitBase.rtc$IMZ", + name: "[.text$mn]", demangled_name: None, normalized_name: None, address: 0, - size: 8, - kind: Object, + size: 0, + kind: Section, section: Some( - 19, + 6, ), - flags: FlagSet(Local | SizeInferred), + flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "[.rtc$TMZ]", - demangled_name: None, + name: "?Vector_MagSquared@@YAMPEAUVector@@@Z", + demangled_name: Some( + "float __cdecl Vector_MagSquared(struct Vector *)", + ), normalized_name: None, address: 0, - size: 0, - kind: Section, + size: 82, + kind: Function, section: Some( - 20, + 6, ), - flags: FlagSet(Local), + flags: FlagSet(Global | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "_RTC_Shutdown.rtc$TMZ", + name: "$LN3", demangled_name: None, normalized_name: None, address: 0, - size: 8, - kind: Object, + size: 0, + kind: Unknown, section: Some( - 20, + 6, ), - flags: FlagSet(Local | SizeInferred), + flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "[.rdata]", + name: "[.rtc$IMZ]", demangled_name: None, normalized_name: None, address: 0, size: 0, kind: Section, section: Some( - 21, + 19, ), flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "__real@00000000", + name: "_RTC_InitBase.rtc$IMZ", demangled_name: None, normalized_name: None, address: 0, - size: 4, + size: 8, kind: Object, section: Some( - 21, + 19, ), - flags: FlagSet(Global | SizeInferred), + flags: FlagSet(Local | SizeInferred), align: None, virtual_address: None, }, Symbol { - name: "[.rdata]", + name: "[.rtc$TMZ]", demangled_name: None, normalized_name: None, address: 0, size: 0, kind: Section, section: Some( - 22, + 20, ), flags: FlagSet(Local), align: None, virtual_address: None, }, Symbol { - name: "__real@3f800000", + name: "_RTC_Shutdown.rtc$TMZ", demangled_name: None, normalized_name: None, address: 0, - size: 4, + size: 8, kind: Object, section: Some( - 22, - ), - flags: FlagSet(Global | SizeInferred), - align: None, - virtual_address: None, - }, - Symbol { - name: "[.chks64]", - demangled_name: None, - normalized_name: None, - address: 0, - size: 192, - kind: Section, - section: Some( - 23, + 20, ), - flags: FlagSet(Local), + flags: FlagSet(Local | SizeInferred), align: None, virtual_address: None, }, @@ -1194,7 +1194,7 @@ Object { 4, ), address: 89, - target_symbol: 6, + target_symbol: 39, addend: 0, }, Relocation { @@ -1202,7 +1202,7 @@ Object { 4, ), address: 124, - target_symbol: 6, + target_symbol: 39, addend: 0, }, Relocation { @@ -1210,7 +1210,7 @@ Object { 4, ), address: 171, - target_symbol: 12, + target_symbol: 45, addend: 0, }, Relocation { @@ -1218,7 +1218,7 @@ Object { 4, ), address: 197, - target_symbol: 12, + target_symbol: 45, addend: 0, }, Relocation { @@ -1226,7 +1226,7 @@ Object { 4, ), address: 212, - target_symbol: 9, + target_symbol: 42, addend: 0, }, Relocation { @@ -1234,7 +1234,7 @@ Object { 4, ), address: 228, - target_symbol: 15, + target_symbol: 48, addend: 0, }, Relocation { @@ -1242,7 +1242,7 @@ Object { 4, ), address: 247, - target_symbol: 50, + target_symbol: 30, addend: 0, }, Relocation { @@ -1250,7 +1250,7 @@ Object { 4, ), address: 286, - target_symbol: 50, + target_symbol: 30, addend: 0, }, Relocation { @@ -1258,7 +1258,7 @@ Object { 4, ), address: 296, - target_symbol: 52, + target_symbol: 32, addend: 0, }, Relocation { @@ -1274,7 +1274,7 @@ Object { 4, ), address: 359, - target_symbol: 6, + target_symbol: 39, addend: 0, }, Relocation { @@ -1282,7 +1282,7 @@ Object { 4, ), address: 392, - target_symbol: 38, + target_symbol: 22, addend: 0, }, Relocation { @@ -1409,7 +1409,7 @@ Object { 3, ), address: 0, - target_symbol: 10, + target_symbol: 43, addend: 0, }, Relocation { @@ -1417,7 +1417,7 @@ Object { 3, ), address: 4, - target_symbol: 10, + target_symbol: 43, addend: 87, }, Relocation { @@ -1425,7 +1425,7 @@ Object { 3, ), address: 8, - target_symbol: 18, + target_symbol: 2, addend: 0, }, ], @@ -1468,7 +1468,7 @@ Object { 3, ), address: 0, - target_symbol: 7, + target_symbol: 40, addend: 0, }, Relocation { @@ -1476,7 +1476,7 @@ Object { 3, ), address: 4, - target_symbol: 7, + target_symbol: 40, addend: 141, }, Relocation { @@ -1484,7 +1484,7 @@ Object { 3, ), address: 8, - target_symbol: 22, + target_symbol: 6, addend: 0, }, ], @@ -1527,7 +1527,7 @@ Object { 3, ), address: 0, - target_symbol: 13, + target_symbol: 46, addend: 0, }, Relocation { @@ -1535,7 +1535,7 @@ Object { 3, ), address: 4, - target_symbol: 13, + target_symbol: 46, addend: 105, }, Relocation { @@ -1543,7 +1543,7 @@ Object { 3, ), address: 8, - target_symbol: 26, + target_symbol: 10, addend: 0, }, ], @@ -1586,7 +1586,7 @@ Object { 3, ), address: 0, - target_symbol: 16, + target_symbol: 49, addend: 0, }, Relocation { @@ -1594,7 +1594,7 @@ Object { 3, ), address: 4, - target_symbol: 16, + target_symbol: 49, addend: 82, }, Relocation { @@ -1602,7 +1602,7 @@ Object { 3, ), address: 8, - target_symbol: 30, + target_symbol: 14, addend: 0, }, ], @@ -1628,7 +1628,7 @@ Object { 1, ), address: 56, - target_symbol: 36, + target_symbol: 20, addend: 0, }, Relocation { @@ -1636,7 +1636,7 @@ Object { 1, ), address: 72, - target_symbol: 35, + target_symbol: 19, addend: 0, }, Relocation { @@ -1644,7 +1644,7 @@ Object { 1, ), address: 88, - target_symbol: 34, + target_symbol: 18, addend: 0, }, Relocation { @@ -1652,7 +1652,7 @@ Object { 1, ), address: 248, - target_symbol: 37, + target_symbol: 21, addend: 0, }, ], @@ -1704,7 +1704,7 @@ Object { 3, ), address: 0, - target_symbol: 4, + target_symbol: 37, addend: 0, }, Relocation { @@ -1712,7 +1712,7 @@ Object { 3, ), address: 4, - target_symbol: 4, + target_symbol: 37, addend: 429, }, Relocation { @@ -1720,7 +1720,7 @@ Object { 3, ), address: 8, - target_symbol: 40, + target_symbol: 24, addend: 0, }, ], diff --git a/objdiff-core/tests/snapshots/arch_x86__read_x86_combine_sections.snap b/objdiff-core/tests/snapshots/arch_x86__read_x86_combine_sections.snap index 2db35939..0dc49738 100644 --- a/objdiff-core/tests/snapshots/arch_x86__read_x86_combine_sections.snap +++ b/objdiff-core/tests/snapshots/arch_x86__read_x86_combine_sections.snap @@ -38,64 +38,13 @@ expression: obj.sections virtual_address: None, }, Section { - id: ".rdata-0", - name: ".rdata", - address: 0, - size: 0, - kind: Unknown, - data: SectionData( - 0, - ), - flags: FlagSet(), - align: Some( - 4, - ), - relocations: [], - line_info: {}, - virtual_address: None, - }, - Section { - id: ".rdata-1", + id: ".rdata-combined", name: ".rdata", address: 0, - size: 0, - kind: Unknown, - data: SectionData( - 0, - ), - flags: FlagSet(), - align: Some( - 4, - ), - relocations: [], - line_info: {}, - virtual_address: None, - }, - Section { - id: ".text$mn-0", - name: ".text$mn", - address: 0, - size: 0, - kind: Unknown, - data: SectionData( - 0, - ), - flags: FlagSet(), - align: Some( - 16, - ), - relocations: [], - line_info: {}, - virtual_address: None, - }, - Section { - id: ".data-combined", - name: ".data", - address: 0, - size: 56, + size: 304, kind: Data, data: SectionData( - 56, + 304, ), flags: FlagSet(Combined), align: Some( @@ -107,65 +56,31 @@ expression: obj.sections 6, ), address: 0, - target_symbol: 71, - addend: 0, - }, - Relocation { - flags: Coff( - 6, - ), - address: 16, - target_symbol: 71, + target_symbol: 32, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 32, - target_symbol: 71, - addend: 0, - }, - Relocation { - flags: Coff( - 6, - ), - address: 48, - target_symbol: 3, + address: 4, + target_symbol: 70, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 52, - target_symbol: 5, + address: 8, + target_symbol: 46, addend: 0, }, - ], - line_info: {}, - virtual_address: None, - }, - Section { - id: ".rdata-combined", - name: ".rdata", - address: 0, - size: 304, - kind: Data, - data: SectionData( - 304, - ), - flags: FlagSet(Combined), - align: Some( - 4, - ), - relocations: [ Relocation { flags: Coff( 6, ), address: 12, - target_symbol: 13, + target_symbol: 44, addend: 0, }, Relocation { @@ -173,95 +88,95 @@ expression: obj.sections 6, ), address: 16, - target_symbol: 15, + target_symbol: 62, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 24, - target_symbol: 9, + address: 20, + target_symbol: 74, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 48, - target_symbol: 11, + address: 24, + target_symbol: 64, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 64, - target_symbol: 21, + address: 28, + target_symbol: 75, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 68, - target_symbol: 23, + address: 44, + target_symbol: 20, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 76, - target_symbol: 17, + address: 48, + target_symbol: 22, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 100, - target_symbol: 19, + address: 56, + target_symbol: 16, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 116, - target_symbol: 27, + address: 80, + target_symbol: 18, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 120, - target_symbol: 29, + address: 96, + target_symbol: 28, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 136, - target_symbol: 31, + address: 100, + target_symbol: 30, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 140, - target_symbol: 33, + address: 108, + target_symbol: 24, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 144, - target_symbol: 15, + address: 132, + target_symbol: 26, addend: 0, }, Relocation { @@ -269,95 +184,95 @@ expression: obj.sections 6, ), address: 148, - target_symbol: 35, + target_symbol: 34, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 156, - target_symbol: 27, + address: 152, + target_symbol: 36, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 180, - target_symbol: 29, + address: 168, + target_symbol: 38, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 184, - target_symbol: 17, + address: 172, + target_symbol: 40, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 208, - target_symbol: 19, + address: 176, + target_symbol: 22, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 224, - target_symbol: 27, + address: 180, + target_symbol: 42, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 228, - target_symbol: 29, + address: 188, + target_symbol: 34, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 244, - target_symbol: 9, + address: 212, + target_symbol: 36, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 248, - target_symbol: 11, + address: 216, + target_symbol: 24, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 264, - target_symbol: 17, + address: 240, + target_symbol: 26, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 268, - target_symbol: 19, + address: 256, + target_symbol: 34, addend: 0, }, Relocation { flags: Coff( 6, ), - address: 272, - target_symbol: 25, + address: 260, + target_symbol: 36, addend: 0, }, Relocation { @@ -365,7 +280,7 @@ expression: obj.sections 6, ), address: 276, - target_symbol: 70, + target_symbol: 16, addend: 0, }, Relocation { @@ -373,31 +288,7 @@ expression: obj.sections 6, ), address: 280, - target_symbol: 39, - addend: 0, - }, - Relocation { - flags: Coff( - 6, - ), - address: 284, - target_symbol: 37, - addend: 0, - }, - Relocation { - flags: Coff( - 6, - ), - address: 288, - target_symbol: 61, - addend: 0, - }, - Relocation { - flags: Coff( - 6, - ), - address: 292, - target_symbol: 74, + target_symbol: 18, addend: 0, }, Relocation { @@ -405,7 +296,7 @@ expression: obj.sections 6, ), address: 296, - target_symbol: 63, + target_symbol: 24, addend: 0, }, Relocation { @@ -413,13 +304,81 @@ expression: obj.sections 6, ), address: 300, - target_symbol: 75, + target_symbol: 26, addend: 0, }, ], line_info: {}, virtual_address: None, }, + Section { + id: ".rdata-1", + name: ".rdata", + address: 0, + size: 0, + kind: Unknown, + data: SectionData( + 0, + ), + flags: FlagSet(), + align: Some( + 4, + ), + relocations: [], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".text$mn-0", + name: ".text$mn", + address: 0, + size: 0, + kind: Unknown, + data: SectionData( + 0, + ), + flags: FlagSet(), + align: Some( + 16, + ), + relocations: [], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".data$rs-0", + name: ".data$rs", + address: 0, + size: 0, + kind: Unknown, + data: SectionData( + 0, + ), + flags: FlagSet(), + align: Some( + 4, + ), + relocations: [], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".rdata$r-0", + name: ".rdata$r", + address: 0, + size: 0, + kind: Unknown, + data: SectionData( + 0, + ), + flags: FlagSet(), + align: Some( + 4, + ), + relocations: [], + line_info: {}, + virtual_address: None, + }, Section { id: ".rdata$r-1", name: ".rdata$r", @@ -762,7 +721,7 @@ expression: obj.sections 6, ), address: 4, - target_symbol: 53, + target_symbol: 60, addend: 0, }, Relocation { @@ -778,7 +737,7 @@ expression: obj.sections 20, ), address: 43, - target_symbol: 45, + target_symbol: 52, addend: 0, }, Relocation { @@ -802,7 +761,7 @@ expression: obj.sections 6, ), address: 100, - target_symbol: 55, + target_symbol: 6, addend: 0, }, Relocation { @@ -810,7 +769,7 @@ expression: obj.sections 6, ), address: 124, - target_symbol: 57, + target_symbol: 8, addend: 0, }, Relocation { @@ -818,7 +777,7 @@ expression: obj.sections 6, ), address: 156, - target_symbol: 3, + target_symbol: 2, addend: 0, }, Relocation { @@ -826,7 +785,7 @@ expression: obj.sections 6, ), address: 166, - target_symbol: 5, + target_symbol: 4, addend: 0, }, Relocation { @@ -834,7 +793,7 @@ expression: obj.sections 20, ), address: 177, - target_symbol: 43, + target_symbol: 50, addend: 0, }, Relocation { @@ -842,7 +801,7 @@ expression: obj.sections 20, ), address: 185, - target_symbol: 41, + target_symbol: 48, addend: 0, }, Relocation { @@ -850,7 +809,7 @@ expression: obj.sections 20, ), address: 219, - target_symbol: 41, + target_symbol: 48, addend: 0, }, Relocation { @@ -866,7 +825,7 @@ expression: obj.sections 20, ), address: 267, - target_symbol: 43, + target_symbol: 50, addend: 0, }, Relocation { @@ -882,7 +841,7 @@ expression: obj.sections 6, ), address: 308, - target_symbol: 59, + target_symbol: 10, addend: 0, }, Relocation { @@ -890,7 +849,7 @@ expression: obj.sections 20, ), address: 313, - target_symbol: 45, + target_symbol: 52, addend: 0, }, ], @@ -949,19 +908,60 @@ expression: obj.sections virtual_address: None, }, Section { - id: ".data-0", + id: ".data-combined", name: ".data", address: 0, - size: 0, - kind: Unknown, + size: 56, + kind: Data, data: SectionData( - 0, + 56, ), - flags: FlagSet(), + flags: FlagSet(Combined), align: Some( 4, ), - relocations: [], + relocations: [ + Relocation { + flags: Coff( + 6, + ), + address: 0, + target_symbol: 2, + addend: 0, + }, + Relocation { + flags: Coff( + 6, + ), + address: 4, + target_symbol: 4, + addend: 0, + }, + Relocation { + flags: Coff( + 6, + ), + address: 8, + target_symbol: 71, + addend: 0, + }, + Relocation { + flags: Coff( + 6, + ), + address: 24, + target_symbol: 71, + addend: 0, + }, + Relocation { + flags: Coff( + 6, + ), + address: 40, + target_symbol: 71, + addend: 0, + }, + ], line_info: {}, virtual_address: None, }, @@ -1018,7 +1018,7 @@ expression: obj.sections 6, ), address: 0, - target_symbol: 51, + target_symbol: 58, addend: 0, }, ], diff --git a/objdiff-core/tests/snapshots/arch_x86__read_x86_indirect_table.snap b/objdiff-core/tests/snapshots/arch_x86__read_x86_indirect_table.snap index c8cfc296..0b406292 100644 --- a/objdiff-core/tests/snapshots/arch_x86__read_x86_indirect_table.snap +++ b/objdiff-core/tests/snapshots/arch_x86__read_x86_indirect_table.snap @@ -23,20 +23,6 @@ Object { align: None, virtual_address: None, }, - Symbol { - name: "[.debug$S]", - demangled_name: None, - normalized_name: None, - address: 0, - size: 271, - kind: Section, - section: Some( - 1, - ), - flags: FlagSet(Local), - align: None, - virtual_address: None, - }, Symbol { name: "[.text]", demangled_name: None, @@ -501,6 +487,20 @@ Object { align: None, virtual_address: None, }, + Symbol { + name: "[.debug$S]", + demangled_name: None, + normalized_name: None, + address: 0, + size: 271, + kind: Section, + section: Some( + 1, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, Symbol { name: "[.debug$S]", demangled_name: None, @@ -610,7 +610,7 @@ Object { 6, ), address: 59, - target_symbol: 28, + target_symbol: 27, addend: 0, }, Relocation { @@ -618,7 +618,7 @@ Object { 6, ), address: 66, - target_symbol: 27, + target_symbol: 26, addend: 0, }, Relocation { @@ -626,7 +626,7 @@ Object { 6, ), address: 154, - target_symbol: 30, + target_symbol: 29, addend: 0, }, Relocation { @@ -634,7 +634,7 @@ Object { 6, ), address: 161, - target_symbol: 29, + target_symbol: 28, addend: 0, }, Relocation { @@ -642,7 +642,7 @@ Object { 6, ), address: 253, - target_symbol: 32, + target_symbol: 31, addend: 0, }, Relocation { @@ -650,7 +650,7 @@ Object { 6, ), address: 260, - target_symbol: 31, + target_symbol: 30, addend: 0, }, Relocation { @@ -658,7 +658,7 @@ Object { 6, ), address: 349, - target_symbol: 34, + target_symbol: 33, addend: 0, }, Relocation { @@ -666,7 +666,7 @@ Object { 6, ), address: 356, - target_symbol: 33, + target_symbol: 32, addend: 0, }, Relocation { @@ -674,7 +674,7 @@ Object { 6, ), address: 424, - target_symbol: 7, + target_symbol: 6, addend: 0, }, Relocation { @@ -682,7 +682,7 @@ Object { 6, ), address: 428, - target_symbol: 22, + target_symbol: 21, addend: 0, }, Relocation { @@ -690,7 +690,7 @@ Object { 6, ), address: 432, - target_symbol: 8, + target_symbol: 7, addend: 0, }, Relocation { @@ -698,7 +698,7 @@ Object { 6, ), address: 436, - target_symbol: 9, + target_symbol: 8, addend: 0, }, Relocation { @@ -706,7 +706,7 @@ Object { 6, ), address: 440, - target_symbol: 10, + target_symbol: 9, addend: 0, }, Relocation { @@ -714,7 +714,7 @@ Object { 6, ), address: 444, - target_symbol: 15, + target_symbol: 14, addend: 0, }, Relocation { @@ -722,7 +722,7 @@ Object { 6, ), address: 652, - target_symbol: 11, + target_symbol: 10, addend: 0, }, Relocation { @@ -730,7 +730,7 @@ Object { 6, ), address: 656, - target_symbol: 12, + target_symbol: 11, addend: 0, }, Relocation { @@ -738,7 +738,7 @@ Object { 6, ), address: 660, - target_symbol: 13, + target_symbol: 12, addend: 0, }, Relocation { @@ -746,7 +746,7 @@ Object { 6, ), address: 664, - target_symbol: 14, + target_symbol: 13, addend: 0, }, Relocation { @@ -754,7 +754,7 @@ Object { 6, ), address: 668, - target_symbol: 15, + target_symbol: 14, addend: 0, }, Relocation { @@ -762,7 +762,7 @@ Object { 6, ), address: 824, - target_symbol: 16, + target_symbol: 15, addend: 0, }, Relocation { @@ -770,7 +770,7 @@ Object { 6, ), address: 828, - target_symbol: 17, + target_symbol: 16, addend: 0, }, Relocation { @@ -778,7 +778,7 @@ Object { 6, ), address: 832, - target_symbol: 18, + target_symbol: 17, addend: 0, }, Relocation { @@ -786,7 +786,7 @@ Object { 6, ), address: 836, - target_symbol: 19, + target_symbol: 18, addend: 0, }, Relocation { @@ -794,7 +794,7 @@ Object { 6, ), address: 840, - target_symbol: 20, + target_symbol: 19, addend: 0, }, Relocation { @@ -802,7 +802,7 @@ Object { 6, ), address: 844, - target_symbol: 21, + target_symbol: 20, addend: 0, }, Relocation { @@ -810,7 +810,7 @@ Object { 6, ), address: 848, - target_symbol: 26, + target_symbol: 25, addend: 0, }, Relocation { @@ -818,7 +818,7 @@ Object { 6, ), address: 1104, - target_symbol: 22, + target_symbol: 21, addend: 0, }, Relocation { @@ -826,7 +826,7 @@ Object { 6, ), address: 1108, - target_symbol: 23, + target_symbol: 22, addend: 0, }, Relocation { @@ -834,7 +834,7 @@ Object { 6, ), address: 1112, - target_symbol: 24, + target_symbol: 23, addend: 0, }, Relocation { @@ -842,7 +842,7 @@ Object { 6, ), address: 1116, - target_symbol: 25, + target_symbol: 24, addend: 0, }, Relocation { @@ -850,7 +850,7 @@ Object { 6, ), address: 1120, - target_symbol: 7, + target_symbol: 6, addend: 0, }, Relocation { @@ -858,7 +858,7 @@ Object { 6, ), address: 1124, - target_symbol: 26, + target_symbol: 25, addend: 0, }, ],