From 7ae981daefd7d1fc26e3b41d3089e352380d19d7 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 9 Nov 2020 10:58:18 +0100 Subject: build: add linker patches for llvm-rc Signed-off-by: Jason A. Donenfeld --- ...al-with-ADDR32NB-relocations-the-same-way.patch | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 go-patches/0002-cmd-link-deal-with-ADDR32NB-relocations-the-same-way.patch (limited to 'go-patches/0002-cmd-link-deal-with-ADDR32NB-relocations-the-same-way.patch') diff --git a/go-patches/0002-cmd-link-deal-with-ADDR32NB-relocations-the-same-way.patch b/go-patches/0002-cmd-link-deal-with-ADDR32NB-relocations-the-same-way.patch new file mode 100644 index 00000000..10137735 --- /dev/null +++ b/go-patches/0002-cmd-link-deal-with-ADDR32NB-relocations-the-same-way.patch @@ -0,0 +1,31 @@ +From b82dc55e45ee47e0df9604593c34d41654db45c8 Mon Sep 17 00:00:00 2001 +From: "Jason A. Donenfeld" +Date: Sun, 8 Nov 2020 03:09:42 +0100 +Subject: [PATCH 2/8] cmd/link: deal with ADDR32NB relocations the same way as + ADDR32 on arm + +As far as I can tell, the addend is the same for both of these, and in +this context we don't really care about setting or unsetting the thumb +selection bit, so just treat these the same way. + +Change-Id: I3756c027239f77778c32b317733df9ac92272580 +--- + src/cmd/link/internal/loadpe/ldpe.go | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/cmd/link/internal/loadpe/ldpe.go b/src/cmd/link/internal/loadpe/ldpe.go +index cf76741f43..5839a6a5f2 100644 +--- a/src/cmd/link/internal/loadpe/ldpe.go ++++ b/src/cmd/link/internal/loadpe/ldpe.go +@@ -308,7 +308,7 @@ func Load(l *loader.Loader, arch *sys.Arch, localSymVersion int, input *bio.Read + + rAdd = int64(int32(binary.LittleEndian.Uint32(sectdata[rsect][rOff:]))) + +- case IMAGE_REL_ARM_ADDR32: ++ case IMAGE_REL_ARM_ADDR32, IMAGE_REL_ARM_ADDR32NB: + rType = objabi.R_ADDR + + rAdd = int64(int32(binary.LittleEndian.Uint32(sectdata[rsect][rOff:]))) +-- +2.29.1 + -- cgit v1.2.3-59-g8ed1b