mirror of
https://git.yoctoproject.org/poky
synced 2026-05-02 18:32:15 +02:00
These are fixes mainly cherrypicks for mips/ppc/x86 mainly fixing PRs in ld and gold (From OE-Core rev: f098cfc24bae8e0685bcae53ea4fdc3326ddc6c4) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
48 lines
1.8 KiB
Diff
48 lines
1.8 KiB
Diff
Upstream-Status: Backport
|
|
|
|
From 97beee82f0e45e65308083a7e4cfaab57623733c Mon Sep 17 00:00:00 2001
|
|
From: cltang <cltang>
|
|
Date: Mon, 19 Dec 2011 10:34:15 +0000
|
|
Subject: [PATCH 035/262] 2011-12-19 Chung-Lin Tang
|
|
<cltang@codesourcery.com>
|
|
|
|
Backport from mainline:
|
|
|
|
2011-12-13 Chung-Lin Tang <cltang@codesourcery.com>
|
|
|
|
* elfxx-mips.c (mips_elf_calculate_relocation): Correct
|
|
R_MIPS16_HI16/R_MIPS16_LO16 handling of two cleared lower bits,
|
|
update comments.
|
|
|
|
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
|
|
index 6b908ad..3939183 100644
|
|
--- a/bfd/elfxx-mips.c
|
|
+++ b/bfd/elfxx-mips.c
|
|
@@ -5531,10 +5531,11 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
|
|
12: addu $v0,$v1
|
|
14: move $gp,$v0
|
|
So the offsets of hi and lo relocs are the same, but the
|
|
- $pc is four higher than $t9 would be, so reduce
|
|
- both reloc addends by 4. */
|
|
+ base $pc is that used by the ADDIUPC instruction at $t9 + 4.
|
|
+ ADDIUPC clears the low two bits of the instruction address,
|
|
+ so the base is ($t9 + 4) & ~3. */
|
|
if (r_type == R_MIPS16_HI16)
|
|
- value = mips_elf_high (addend + gp - p - 4);
|
|
+ value = mips_elf_high (addend + gp - ((p + 4) & ~(bfd_vma) 0x3));
|
|
/* The microMIPS .cpload sequence uses the same assembly
|
|
instructions as the traditional psABI version, but the
|
|
incoming $t9 has the low bit set. */
|
|
@@ -5557,7 +5558,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
|
|
/* See the comment for R_MIPS16_HI16 above for the reason
|
|
for this conditional. */
|
|
if (r_type == R_MIPS16_LO16)
|
|
- value = addend + gp - p;
|
|
+ value = addend + gp - (p & ~(bfd_vma) 0x3);
|
|
else if (r_type == R_MICROMIPS_LO16
|
|
|| r_type == R_MICROMIPS_HI0_LO16)
|
|
value = addend + gp - p + 3;
|
|
--
|
|
1.7.9.5
|
|
|