From 23db11c2c3b299e984d6be058e6c064101d8799c Mon Sep 17 00:00:00 2001 From: Philip Craig Date: Sun, 20 Nov 2022 14:45:21 +1000 Subject: [PATCH] read/xcoff: fix parsing of relocation size (#486) --- .../examples/testfiles/xcoff/base.o.objdump | 10 +- .../testfiles/xcoff/base.xcoff.objdump | 136 +++++++++--------- .../examples/testfiles/xcoff/base32.o.objdump | 10 +- .../testfiles/xcoff/base32.xcoff.objdump | 128 ++++++++--------- src/read/xcoff/relocation.rs | 2 +- 5 files changed, 143 insertions(+), 143 deletions(-) diff --git a/crates/examples/testfiles/xcoff/base.o.objdump b/crates/examples/testfiles/xcoff/base.o.objdump index 3e2a989a..7154e67a 100644 --- a/crates/examples/testfiles/xcoff/base.o.objdump +++ b/crates/examples/testfiles/xcoff/base.o.objdump @@ -19,12 +19,12 @@ Symbols 17: Symbol { name: ".rodata.str1.1L...str", address: 80, size: 8, kind: Data, section: Section(SectionIndex(2)), scope: Dynamic, weak: false, flags: None } .text relocations -(1e, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(11)), addend: 0, implicit_addend: true }) -(20, Relocation { kind: Relative, encoding: Generic, size: 0, target: Symbol(SymbolIndex(3)), addend: fffffffffffffffc, implicit_addend: true }) +(1e, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(11)), addend: 0, implicit_addend: true }) +(20, Relocation { kind: Relative, encoding: Generic, size: 1a, target: Symbol(SymbolIndex(3)), addend: fffffffffffffffc, implicit_addend: true }) .data relocations -(68, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(9)), addend: 0, implicit_addend: true }) -(70, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(f)), addend: 0, implicit_addend: true }) -(80, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(b)), addend: 0, implicit_addend: true }) +(68, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(9)), addend: 0, implicit_addend: true }) +(70, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(f)), addend: 0, implicit_addend: true }) +(80, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(b)), addend: 0, implicit_addend: true }) Dynamic symbols diff --git a/crates/examples/testfiles/xcoff/base.xcoff.objdump b/crates/examples/testfiles/xcoff/base.xcoff.objdump index 3965d56b..0e17c788 100644 --- a/crates/examples/testfiles/xcoff/base.xcoff.objdump +++ b/crates/examples/testfiles/xcoff/base.xcoff.objdump @@ -91,75 +91,75 @@ Symbols 154: Symbol { name: ".printf", address: 100000698, size: 0, kind: Text, section: Section(SectionIndex(1)), scope: Dynamic, weak: false, flags: None } .text relocations -(1000001fa, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(46)), addend: 0, implicit_addend: true }) -(1000001fe, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(16)), addend: 0, implicit_addend: true }) -(10000020e, Relocation { kind: Xcoff(13), encoding: Generic, size: 40, target: Symbol(SymbolIndex(18)), addend: 0, implicit_addend: true }) -(100000212, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(28)), addend: 0, implicit_addend: true }) -(100000216, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(2a)), addend: 0, implicit_addend: true }) -(10000021a, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(3e)), addend: 0, implicit_addend: true }) -(10000021e, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(40)), addend: 0, implicit_addend: true }) -(10000022e, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(2c)), addend: 0, implicit_addend: true }) -(100000252, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(3e)), addend: 0, implicit_addend: true }) -(10000025a, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(2e)), addend: 0, implicit_addend: true }) -(100000268, Relocation { kind: Relative, encoding: Generic, size: 0, target: Symbol(SymbolIndex(7f)), addend: fffffffffffffffc, implicit_addend: true }) -(100000272, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(42)), addend: 0, implicit_addend: true }) -(10000027e, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(44)), addend: 0, implicit_addend: true }) -(100000280, Relocation { kind: Relative, encoding: Generic, size: 0, target: Symbol(SymbolIndex(86)), addend: fffffffffffffffc, implicit_addend: true }) -(1000002c2, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(56)), addend: 0, implicit_addend: true }) -(10000030a, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(56)), addend: 0, implicit_addend: true }) -(10000032e, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(58)), addend: 0, implicit_addend: true }) -(100000352, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(5a)), addend: 0, implicit_addend: true }) -(100000376, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(5c)), addend: 0, implicit_addend: true }) -(10000039a, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(5e)), addend: 0, implicit_addend: true }) -(1000003ce, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(5c)), addend: 0, implicit_addend: true }) -(100000408, Relocation { kind: Xcoff(f), encoding: Generic, size: 0, target: Symbol(SymbolIndex(52)), addend: 0, implicit_addend: true }) -(100000454, Relocation { kind: Relative, encoding: Generic, size: 0, target: Symbol(SymbolIndex(8b)), addend: fffffffffffffffc, implicit_addend: true }) -(1000004a2, Relocation { kind: Xcoff(13), encoding: Generic, size: 40, target: Symbol(SymbolIndex(1c)), addend: 0, implicit_addend: true }) -(1000004aa, Relocation { kind: Xcoff(13), encoding: Generic, size: 40, target: Symbol(SymbolIndex(1e)), addend: 0, implicit_addend: true }) -(1000004cc, Relocation { kind: Relative, encoding: Generic, size: 0, target: Symbol(SymbolIndex(90)), addend: fffffffffffffffc, implicit_addend: true }) -(1000004d6, Relocation { kind: Xcoff(13), encoding: Generic, size: 40, target: Symbol(SymbolIndex(22)), addend: 0, implicit_addend: true }) -(1000004d8, Relocation { kind: Relative, encoding: Generic, size: 0, target: Symbol(SymbolIndex(95)), addend: fffffffffffffffc, implicit_addend: true }) -(100000540, Relocation { kind: Relative, encoding: Generic, size: 0, target: Symbol(SymbolIndex(8b)), addend: fffffffffffffffc, implicit_addend: true }) -(10000054c, Relocation { kind: Relative, encoding: Generic, size: 0, target: Symbol(SymbolIndex(86)), addend: fffffffffffffffc, implicit_addend: true }) -(10000059a, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(1a)), addend: 0, implicit_addend: true }) -(1000005c2, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(20)), addend: 0, implicit_addend: true }) -(1000005ea, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(24)), addend: 0, implicit_addend: true }) -(100000612, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(26)), addend: 0, implicit_addend: true }) -(10000065e, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(30)), addend: 0, implicit_addend: true }) -(100000660, Relocation { kind: Relative, encoding: Generic, size: 0, target: Symbol(SymbolIndex(9a)), addend: fffffffffffffffc, implicit_addend: true }) -(10000069a, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(32)), addend: 0, implicit_addend: true }) +(1000001fa, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(46)), addend: 0, implicit_addend: true }) +(1000001fe, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(16)), addend: 0, implicit_addend: true }) +(10000020e, Relocation { kind: Xcoff(13), encoding: Generic, size: 10, target: Symbol(SymbolIndex(18)), addend: 0, implicit_addend: true }) +(100000212, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(28)), addend: 0, implicit_addend: true }) +(100000216, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(2a)), addend: 0, implicit_addend: true }) +(10000021a, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(3e)), addend: 0, implicit_addend: true }) +(10000021e, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(40)), addend: 0, implicit_addend: true }) +(10000022e, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(2c)), addend: 0, implicit_addend: true }) +(100000252, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(3e)), addend: 0, implicit_addend: true }) +(10000025a, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(2e)), addend: 0, implicit_addend: true }) +(100000268, Relocation { kind: Relative, encoding: Generic, size: 1a, target: Symbol(SymbolIndex(7f)), addend: fffffffffffffffc, implicit_addend: true }) +(100000272, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(42)), addend: 0, implicit_addend: true }) +(10000027e, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(44)), addend: 0, implicit_addend: true }) +(100000280, Relocation { kind: Relative, encoding: Generic, size: 1a, target: Symbol(SymbolIndex(86)), addend: fffffffffffffffc, implicit_addend: true }) +(1000002c2, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(56)), addend: 0, implicit_addend: true }) +(10000030a, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(56)), addend: 0, implicit_addend: true }) +(10000032e, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(58)), addend: 0, implicit_addend: true }) +(100000352, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(5a)), addend: 0, implicit_addend: true }) +(100000376, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(5c)), addend: 0, implicit_addend: true }) +(10000039a, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(5e)), addend: 0, implicit_addend: true }) +(1000003ce, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(5c)), addend: 0, implicit_addend: true }) +(100000408, Relocation { kind: Xcoff(f), encoding: Generic, size: 40, target: Symbol(SymbolIndex(52)), addend: 0, implicit_addend: true }) +(100000454, Relocation { kind: Relative, encoding: Generic, size: 1a, target: Symbol(SymbolIndex(8b)), addend: fffffffffffffffc, implicit_addend: true }) +(1000004a2, Relocation { kind: Xcoff(13), encoding: Generic, size: 10, target: Symbol(SymbolIndex(1c)), addend: 0, implicit_addend: true }) +(1000004aa, Relocation { kind: Xcoff(13), encoding: Generic, size: 10, target: Symbol(SymbolIndex(1e)), addend: 0, implicit_addend: true }) +(1000004cc, Relocation { kind: Relative, encoding: Generic, size: 1a, target: Symbol(SymbolIndex(90)), addend: fffffffffffffffc, implicit_addend: true }) +(1000004d6, Relocation { kind: Xcoff(13), encoding: Generic, size: 10, target: Symbol(SymbolIndex(22)), addend: 0, implicit_addend: true }) +(1000004d8, Relocation { kind: Relative, encoding: Generic, size: 1a, target: Symbol(SymbolIndex(95)), addend: fffffffffffffffc, implicit_addend: true }) +(100000540, Relocation { kind: Relative, encoding: Generic, size: 1a, target: Symbol(SymbolIndex(8b)), addend: fffffffffffffffc, implicit_addend: true }) +(10000054c, Relocation { kind: Relative, encoding: Generic, size: 1a, target: Symbol(SymbolIndex(86)), addend: fffffffffffffffc, implicit_addend: true }) +(10000059a, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(1a)), addend: 0, implicit_addend: true }) +(1000005c2, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(20)), addend: 0, implicit_addend: true }) +(1000005ea, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(24)), addend: 0, implicit_addend: true }) +(100000612, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(26)), addend: 0, implicit_addend: true }) +(10000065e, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(30)), addend: 0, implicit_addend: true }) +(100000660, Relocation { kind: Relative, encoding: Generic, size: 1a, target: Symbol(SymbolIndex(9a)), addend: fffffffffffffffc, implicit_addend: true }) +(10000069a, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(32)), addend: 0, implicit_addend: true }) .data relocations -(1100006d0, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(3e)), addend: 0, implicit_addend: true }) -(1100006d8, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(54)), addend: 0, implicit_addend: true }) -(1100006e0, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(78)), addend: 0, implicit_addend: true }) -(110000728, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(4)), addend: 0, implicit_addend: true }) -(110000798, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(74)), addend: 0, implicit_addend: true }) -(1100007b0, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(70)), addend: 0, implicit_addend: true }) -(110000848, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(36)), addend: 0, implicit_addend: true }) -(110000850, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(14)), addend: 0, implicit_addend: true }) -(110000858, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(4e)), addend: 0, implicit_addend: true }) -(110000860, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(14)), addend: 0, implicit_addend: true }) -(110000870, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(6a)), addend: 0, implicit_addend: true }) -(110000878, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(14)), addend: 0, implicit_addend: true }) -(110000888, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(6c)), addend: 0, implicit_addend: true }) -(110000890, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(14)), addend: 0, implicit_addend: true }) -(1100008a0, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(68)), addend: 0, implicit_addend: true }) -(1100008a8, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(14)), addend: 0, implicit_addend: true }) -(110000900, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(10)), addend: 0, implicit_addend: true }) -(110000908, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(3c)), addend: 0, implicit_addend: true }) -(110000910, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(a)), addend: 0, implicit_addend: true }) -(110000918, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(6e)), addend: 0, implicit_addend: true }) -(110000920, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(72)), addend: 0, implicit_addend: true }) -(110000928, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(6)), addend: 0, implicit_addend: true }) -(110000930, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(76)), addend: 0, implicit_addend: true }) -(110000938, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(c)), addend: 0, implicit_addend: true }) -(110000940, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(4)), addend: 0, implicit_addend: true }) -(110000948, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(e)), addend: 0, implicit_addend: true }) -(110000950, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(2)), addend: 0, implicit_addend: true }) -(110000958, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(12)), addend: 0, implicit_addend: true }) -(110000960, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(0)), addend: 0, implicit_addend: true }) -(110000968, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(81)), addend: 0, implicit_addend: true }) -(110000970, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(8)), addend: 0, implicit_addend: true }) +(1100006d0, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(3e)), addend: 0, implicit_addend: true }) +(1100006d8, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(54)), addend: 0, implicit_addend: true }) +(1100006e0, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(78)), addend: 0, implicit_addend: true }) +(110000728, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(4)), addend: 0, implicit_addend: true }) +(110000798, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(74)), addend: 0, implicit_addend: true }) +(1100007b0, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(70)), addend: 0, implicit_addend: true }) +(110000848, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(36)), addend: 0, implicit_addend: true }) +(110000850, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(14)), addend: 0, implicit_addend: true }) +(110000858, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(4e)), addend: 0, implicit_addend: true }) +(110000860, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(14)), addend: 0, implicit_addend: true }) +(110000870, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(6a)), addend: 0, implicit_addend: true }) +(110000878, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(14)), addend: 0, implicit_addend: true }) +(110000888, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(6c)), addend: 0, implicit_addend: true }) +(110000890, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(14)), addend: 0, implicit_addend: true }) +(1100008a0, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(68)), addend: 0, implicit_addend: true }) +(1100008a8, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(14)), addend: 0, implicit_addend: true }) +(110000900, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(10)), addend: 0, implicit_addend: true }) +(110000908, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(3c)), addend: 0, implicit_addend: true }) +(110000910, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(a)), addend: 0, implicit_addend: true }) +(110000918, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(6e)), addend: 0, implicit_addend: true }) +(110000920, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(72)), addend: 0, implicit_addend: true }) +(110000928, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(6)), addend: 0, implicit_addend: true }) +(110000930, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(76)), addend: 0, implicit_addend: true }) +(110000938, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(c)), addend: 0, implicit_addend: true }) +(110000940, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(4)), addend: 0, implicit_addend: true }) +(110000948, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(e)), addend: 0, implicit_addend: true }) +(110000950, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(2)), addend: 0, implicit_addend: true }) +(110000958, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(12)), addend: 0, implicit_addend: true }) +(110000960, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(0)), addend: 0, implicit_addend: true }) +(110000968, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(81)), addend: 0, implicit_addend: true }) +(110000970, Relocation { kind: Absolute, encoding: Generic, size: 40, target: Symbol(SymbolIndex(8)), addend: 0, implicit_addend: true }) Dynamic symbols diff --git a/crates/examples/testfiles/xcoff/base32.o.objdump b/crates/examples/testfiles/xcoff/base32.o.objdump index f6f10acc..3601e09f 100644 --- a/crates/examples/testfiles/xcoff/base32.o.objdump +++ b/crates/examples/testfiles/xcoff/base32.o.objdump @@ -19,12 +19,12 @@ Symbols 17: Symbol { name: ".rodata.str1.1L...str", address: 78, size: 4, kind: Data, section: Section(SectionIndex(2)), scope: Dynamic, weak: false, flags: None } .text relocations -(22, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(11)), addend: 0, implicit_addend: true }) -(24, Relocation { kind: Relative, encoding: Generic, size: 0, target: Symbol(SymbolIndex(3)), addend: fffffffffffffffc, implicit_addend: true }) +(22, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(11)), addend: 0, implicit_addend: true }) +(24, Relocation { kind: Relative, encoding: Generic, size: 1a, target: Symbol(SymbolIndex(3)), addend: fffffffffffffffc, implicit_addend: true }) .data relocations -(6c, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(9)), addend: 0, implicit_addend: true }) -(70, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(f)), addend: 0, implicit_addend: true }) -(78, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(b)), addend: 0, implicit_addend: true }) +(6c, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(9)), addend: 0, implicit_addend: true }) +(70, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(f)), addend: 0, implicit_addend: true }) +(78, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(b)), addend: 0, implicit_addend: true }) Dynamic symbols diff --git a/crates/examples/testfiles/xcoff/base32.xcoff.objdump b/crates/examples/testfiles/xcoff/base32.xcoff.objdump index 4b9dbf39..c384254b 100644 --- a/crates/examples/testfiles/xcoff/base32.xcoff.objdump +++ b/crates/examples/testfiles/xcoff/base32.xcoff.objdump @@ -89,71 +89,71 @@ Symbols 150: Symbol { name: ".printf", address: 100005bc, size: 0, kind: Text, section: Section(SectionIndex(1)), scope: Dynamic, weak: false, flags: None } .text relocations -(1000012a, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(42)), addend: 0, implicit_addend: true }) -(1000012e, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(14)), addend: 0, implicit_addend: true }) -(10000146, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(16)), addend: 0, implicit_addend: true }) -(1000014a, Relocation { kind: Xcoff(13), encoding: Generic, size: 40, target: Symbol(SymbolIndex(18)), addend: 0, implicit_addend: true }) -(1000014e, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(3a)), addend: 0, implicit_addend: true }) -(10000152, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(3c)), addend: 0, implicit_addend: true }) -(10000162, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(28)), addend: 0, implicit_addend: true }) -(10000182, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(2a)), addend: 0, implicit_addend: true }) -(10000190, Relocation { kind: Relative, encoding: Generic, size: 0, target: Symbol(SymbolIndex(7b)), addend: fffffffffffffffc, implicit_addend: true }) -(1000019a, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(3e)), addend: 0, implicit_addend: true }) -(100001a6, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(40)), addend: 0, implicit_addend: true }) -(100001a8, Relocation { kind: Relative, encoding: Generic, size: 0, target: Symbol(SymbolIndex(82)), addend: fffffffffffffffc, implicit_addend: true }) -(100001e2, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(52)), addend: 0, implicit_addend: true }) -(1000022a, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(52)), addend: 0, implicit_addend: true }) -(1000024e, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(54)), addend: 0, implicit_addend: true }) -(10000272, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(56)), addend: 0, implicit_addend: true }) -(10000296, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(58)), addend: 0, implicit_addend: true }) -(100002ba, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(5a)), addend: 0, implicit_addend: true }) -(100002ee, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(58)), addend: 0, implicit_addend: true }) -(10000328, Relocation { kind: Xcoff(f), encoding: Generic, size: 0, target: Symbol(SymbolIndex(4e)), addend: 0, implicit_addend: true }) -(10000374, Relocation { kind: Relative, encoding: Generic, size: 0, target: Symbol(SymbolIndex(87)), addend: fffffffffffffffc, implicit_addend: true }) -(100003c2, Relocation { kind: Xcoff(13), encoding: Generic, size: 40, target: Symbol(SymbolIndex(1c)), addend: 0, implicit_addend: true }) -(100003ca, Relocation { kind: Xcoff(13), encoding: Generic, size: 40, target: Symbol(SymbolIndex(1e)), addend: 0, implicit_addend: true }) -(100003ec, Relocation { kind: Relative, encoding: Generic, size: 0, target: Symbol(SymbolIndex(8c)), addend: fffffffffffffffc, implicit_addend: true }) -(100003f6, Relocation { kind: Xcoff(13), encoding: Generic, size: 40, target: Symbol(SymbolIndex(22)), addend: 0, implicit_addend: true }) -(100003f8, Relocation { kind: Relative, encoding: Generic, size: 0, target: Symbol(SymbolIndex(91)), addend: fffffffffffffffc, implicit_addend: true }) -(10000460, Relocation { kind: Relative, encoding: Generic, size: 0, target: Symbol(SymbolIndex(87)), addend: fffffffffffffffc, implicit_addend: true }) -(1000046c, Relocation { kind: Relative, encoding: Generic, size: 0, target: Symbol(SymbolIndex(82)), addend: fffffffffffffffc, implicit_addend: true }) -(100004ba, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(1a)), addend: 0, implicit_addend: true }) -(100004e2, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(20)), addend: 0, implicit_addend: true }) -(1000050a, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(24)), addend: 0, implicit_addend: true }) -(10000532, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(26)), addend: 0, implicit_addend: true }) -(10000582, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(2c)), addend: 0, implicit_addend: true }) -(10000584, Relocation { kind: Relative, encoding: Generic, size: 0, target: Symbol(SymbolIndex(96)), addend: fffffffffffffffc, implicit_addend: true }) -(100005be, Relocation { kind: Got, encoding: Generic, size: 0, target: Symbol(SymbolIndex(2e)), addend: 0, implicit_addend: true }) +(1000012a, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(42)), addend: 0, implicit_addend: true }) +(1000012e, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(14)), addend: 0, implicit_addend: true }) +(10000146, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(16)), addend: 0, implicit_addend: true }) +(1000014a, Relocation { kind: Xcoff(13), encoding: Generic, size: 10, target: Symbol(SymbolIndex(18)), addend: 0, implicit_addend: true }) +(1000014e, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(3a)), addend: 0, implicit_addend: true }) +(10000152, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(3c)), addend: 0, implicit_addend: true }) +(10000162, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(28)), addend: 0, implicit_addend: true }) +(10000182, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(2a)), addend: 0, implicit_addend: true }) +(10000190, Relocation { kind: Relative, encoding: Generic, size: 1a, target: Symbol(SymbolIndex(7b)), addend: fffffffffffffffc, implicit_addend: true }) +(1000019a, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(3e)), addend: 0, implicit_addend: true }) +(100001a6, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(40)), addend: 0, implicit_addend: true }) +(100001a8, Relocation { kind: Relative, encoding: Generic, size: 1a, target: Symbol(SymbolIndex(82)), addend: fffffffffffffffc, implicit_addend: true }) +(100001e2, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(52)), addend: 0, implicit_addend: true }) +(1000022a, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(52)), addend: 0, implicit_addend: true }) +(1000024e, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(54)), addend: 0, implicit_addend: true }) +(10000272, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(56)), addend: 0, implicit_addend: true }) +(10000296, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(58)), addend: 0, implicit_addend: true }) +(100002ba, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(5a)), addend: 0, implicit_addend: true }) +(100002ee, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(58)), addend: 0, implicit_addend: true }) +(10000328, Relocation { kind: Xcoff(f), encoding: Generic, size: 20, target: Symbol(SymbolIndex(4e)), addend: 0, implicit_addend: true }) +(10000374, Relocation { kind: Relative, encoding: Generic, size: 1a, target: Symbol(SymbolIndex(87)), addend: fffffffffffffffc, implicit_addend: true }) +(100003c2, Relocation { kind: Xcoff(13), encoding: Generic, size: 10, target: Symbol(SymbolIndex(1c)), addend: 0, implicit_addend: true }) +(100003ca, Relocation { kind: Xcoff(13), encoding: Generic, size: 10, target: Symbol(SymbolIndex(1e)), addend: 0, implicit_addend: true }) +(100003ec, Relocation { kind: Relative, encoding: Generic, size: 1a, target: Symbol(SymbolIndex(8c)), addend: fffffffffffffffc, implicit_addend: true }) +(100003f6, Relocation { kind: Xcoff(13), encoding: Generic, size: 10, target: Symbol(SymbolIndex(22)), addend: 0, implicit_addend: true }) +(100003f8, Relocation { kind: Relative, encoding: Generic, size: 1a, target: Symbol(SymbolIndex(91)), addend: fffffffffffffffc, implicit_addend: true }) +(10000460, Relocation { kind: Relative, encoding: Generic, size: 1a, target: Symbol(SymbolIndex(87)), addend: fffffffffffffffc, implicit_addend: true }) +(1000046c, Relocation { kind: Relative, encoding: Generic, size: 1a, target: Symbol(SymbolIndex(82)), addend: fffffffffffffffc, implicit_addend: true }) +(100004ba, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(1a)), addend: 0, implicit_addend: true }) +(100004e2, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(20)), addend: 0, implicit_addend: true }) +(1000050a, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(24)), addend: 0, implicit_addend: true }) +(10000532, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(26)), addend: 0, implicit_addend: true }) +(10000582, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(2c)), addend: 0, implicit_addend: true }) +(10000584, Relocation { kind: Relative, encoding: Generic, size: 1a, target: Symbol(SymbolIndex(96)), addend: fffffffffffffffc, implicit_addend: true }) +(100005be, Relocation { kind: Got, encoding: Generic, size: 10, target: Symbol(SymbolIndex(2e)), addend: 0, implicit_addend: true }) .data relocations -(200005f4, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(3a)), addend: 0, implicit_addend: true }) -(200005f8, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(50)), addend: 0, implicit_addend: true }) -(20000600, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(74)), addend: 0, implicit_addend: true }) -(2000067c, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(70)), addend: 0, implicit_addend: true }) -(2000068c, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(6c)), addend: 0, implicit_addend: true }) -(20000710, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(32)), addend: 0, implicit_addend: true }) -(20000714, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(12)), addend: 0, implicit_addend: true }) -(20000718, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(4a)), addend: 0, implicit_addend: true }) -(2000071c, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(12)), addend: 0, implicit_addend: true }) -(20000724, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(66)), addend: 0, implicit_addend: true }) -(20000728, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(12)), addend: 0, implicit_addend: true }) -(20000730, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(68)), addend: 0, implicit_addend: true }) -(20000734, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(12)), addend: 0, implicit_addend: true }) -(2000073c, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(64)), addend: 0, implicit_addend: true }) -(20000740, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(12)), addend: 0, implicit_addend: true }) -(20000770, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(e)), addend: 0, implicit_addend: true }) -(20000774, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(c)), addend: 0, implicit_addend: true }) -(20000778, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(38)), addend: 0, implicit_addend: true }) -(2000077c, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(8)), addend: 0, implicit_addend: true }) -(20000780, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(6a)), addend: 0, implicit_addend: true }) -(20000784, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(6e)), addend: 0, implicit_addend: true }) -(20000788, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(4)), addend: 0, implicit_addend: true }) -(2000078c, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(72)), addend: 0, implicit_addend: true }) -(20000790, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(a)), addend: 0, implicit_addend: true }) -(20000794, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(2)), addend: 0, implicit_addend: true }) -(20000798, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(10)), addend: 0, implicit_addend: true }) -(2000079c, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(0)), addend: 0, implicit_addend: true }) -(200007a0, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(7d)), addend: 0, implicit_addend: true }) -(200007a4, Relocation { kind: Absolute, encoding: Generic, size: 0, target: Symbol(SymbolIndex(6)), addend: 0, implicit_addend: true }) +(200005f4, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(3a)), addend: 0, implicit_addend: true }) +(200005f8, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(50)), addend: 0, implicit_addend: true }) +(20000600, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(74)), addend: 0, implicit_addend: true }) +(2000067c, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(70)), addend: 0, implicit_addend: true }) +(2000068c, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(6c)), addend: 0, implicit_addend: true }) +(20000710, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(32)), addend: 0, implicit_addend: true }) +(20000714, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(12)), addend: 0, implicit_addend: true }) +(20000718, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(4a)), addend: 0, implicit_addend: true }) +(2000071c, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(12)), addend: 0, implicit_addend: true }) +(20000724, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(66)), addend: 0, implicit_addend: true }) +(20000728, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(12)), addend: 0, implicit_addend: true }) +(20000730, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(68)), addend: 0, implicit_addend: true }) +(20000734, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(12)), addend: 0, implicit_addend: true }) +(2000073c, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(64)), addend: 0, implicit_addend: true }) +(20000740, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(12)), addend: 0, implicit_addend: true }) +(20000770, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(e)), addend: 0, implicit_addend: true }) +(20000774, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(c)), addend: 0, implicit_addend: true }) +(20000778, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(38)), addend: 0, implicit_addend: true }) +(2000077c, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(8)), addend: 0, implicit_addend: true }) +(20000780, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(6a)), addend: 0, implicit_addend: true }) +(20000784, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(6e)), addend: 0, implicit_addend: true }) +(20000788, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(4)), addend: 0, implicit_addend: true }) +(2000078c, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(72)), addend: 0, implicit_addend: true }) +(20000790, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(a)), addend: 0, implicit_addend: true }) +(20000794, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(2)), addend: 0, implicit_addend: true }) +(20000798, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(10)), addend: 0, implicit_addend: true }) +(2000079c, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(0)), addend: 0, implicit_addend: true }) +(200007a0, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(7d)), addend: 0, implicit_addend: true }) +(200007a4, Relocation { kind: Absolute, encoding: Generic, size: 20, target: Symbol(SymbolIndex(6)), addend: 0, implicit_addend: true }) Dynamic symbols diff --git a/src/read/xcoff/relocation.rs b/src/read/xcoff/relocation.rs index 013bdf6d..3913a852 100644 --- a/src/read/xcoff/relocation.rs +++ b/src/read/xcoff/relocation.rs @@ -50,7 +50,7 @@ where xcoff::R_TOC | xcoff::R_TOCL | xcoff::R_TOCU => (RelocationKind::Got, 0), r_type => (RelocationKind::Xcoff(r_type), 0), }; - let size = relocation.r_rsize() & 0x3F + 1; + let size = (relocation.r_rsize() & 0x3F) + 1; let target = RelocationTarget::Symbol(SymbolIndex(relocation.r_symndx() as usize)); ( u64::from(relocation.r_vaddr().into()),