board/csky: fixup gdb instructions in readme.txt
[buildroot-gz.git] / package / binutils / 2.25.1 / 915-Correct-assertion-in-NIOS2-linker-to-allow-signed-16.patch
blob6ae9d9afc4dd369ab21575bd22aa7e26e8ed3071
1 From d07f38875f37f4608e8ecb761619d84716896f14 Mon Sep 17 00:00:00 2001
2 From: Nick Clifton <nickc@redhat.com>
3 Date: Wed, 10 Feb 2016 11:25:59 +0000
4 Subject: [PATCH] Correct assertion in NIOS2 linker to allow signed 16-buit
5 immediate values.
7 PR 19405
8 * elf32-nios2.c (nios2_elf32_install_imm16): Allow for signed
9 immediate values.
10 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Limit the
11 number of messages about FDE encoding preventing .eh_frame_hdr
12 generation.
14 [Romain: rebase on 2.25.1]
15 Signed-off-by: Romain Naour <romain.naour@gmail.com>
16 ---
17 bfd/elf-eh-frame.c | 18 +++++++++++++++---
18 bfd/elf32-nios2.c | 2 +-
19 2 files changed, 16 insertions(+), 4 deletions(-)
21 diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
22 index 002932d..22430f9 100644
23 --- a/bfd/elf-eh-frame.c
24 +++ b/bfd/elf-eh-frame.c
25 @@ -1181,14 +1181,26 @@ _bfd_elf_discard_section_eh_frame
26 && ent->make_relative == 0)
27 || (ent->fde_encoding & 0x70) == DW_EH_PE_aligned))
29 + static int num_warnings_issued = 0;
31 /* If a shared library uses absolute pointers
32 which we cannot turn into PC relative,
33 don't create the binary search table,
34 since it is affected by runtime relocations. */
35 hdr_info->table = FALSE;
36 - (*info->callbacks->einfo)
37 - (_("%P: FDE encoding in %B(%A) prevents .eh_frame_hdr"
38 - " table being created.\n"), abfd, sec);
39 + if (num_warnings_issued < 10)
40 + {
41 + (*info->callbacks->einfo)
42 + (_("%P: FDE encoding in %B(%A) prevents .eh_frame_hdr"
43 + " table being created.\n"), abfd, sec);
44 + num_warnings_issued ++;
45 + }
46 + else if (num_warnings_issued == 10)
47 + {
48 + (*info->callbacks->einfo)
49 + (_("%P: Further warnings about FDE encoding preventing .eh_frame_hdr generation dropped.\n"));
50 + num_warnings_issued ++;
51 + }
53 ent->removed = 0;
54 hdr_info->fde_count++;
55 diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c
56 index 0105b70..726647d 100644
57 --- a/bfd/elf32-nios2.c
58 +++ b/bfd/elf32-nios2.c
59 @@ -1035,7 +1035,7 @@ nios2_elf32_install_imm16 (asection *sec, bfd_vma offset, bfd_vma value)
61 bfd_vma word = bfd_get_32 (sec->owner, sec->contents + offset);
63 - BFD_ASSERT(value <= 0xffff);
64 + BFD_ASSERT (value <= 0xffff || ((bfd_signed_vma) value) >= -0xffff);
66 bfd_put_32 (sec->owner, word | ((value & 0xffff) << 6),
67 sec->contents + offset);
68 --
69 2.4.3