| ... | @@ -1658,6 +1658,7 @@ const aarch64 = struct { | ... | @@ -1658,6 +1658,7 @@ const aarch64 = struct { |
| 1658 | .LDST32_ABS_LO12_NC, | 1658 | .LDST32_ABS_LO12_NC, |
| 1659 | .LDST64_ABS_LO12_NC, | 1659 | .LDST64_ABS_LO12_NC, |
| 1660 | .LDST128_ABS_LO12_NC, | 1660 | .LDST128_ABS_LO12_NC, |
| | 1661 | .PREL32, |
| 1661 | => {}, | 1662 | => {}, |
| 1662 | | 1663 | |
| 1663 | else => try atom.reportUnhandledRelocError(rel, elf_file), | 1664 | else => try atom.reportUnhandledRelocError(rel, elf_file), |
| ... | @@ -1716,6 +1717,11 @@ const aarch64 = struct { | ... | @@ -1716,6 +1717,11 @@ const aarch64 = struct { |
| 1716 | aarch64_util.writeBranchImm(disp, code); | 1717 | aarch64_util.writeBranchImm(disp, code); |
| 1717 | }, | 1718 | }, |
| 1718 | | 1719 | |
| | 1720 | .PREL32 => { |
| | 1721 | const value = math.cast(i32, S + A - P) orelse return error.Overflow; |
| | 1722 | mem.writeInt(u32, code, @bitCast(value), .little); |
| | 1723 | }, |
| | 1724 | |
| 1719 | .ADR_PREL_PG_HI21 => { | 1725 | .ADR_PREL_PG_HI21 => { |
| 1720 | // TODO: check for relaxation of ADRP+ADD | 1726 | // TODO: check for relaxation of ADRP+ADD |
| 1721 | const saddr = @as(u64, @intCast(P)); | 1727 | const saddr = @as(u64, @intCast(P)); |