toolchain: bump Codescape IMG MIPS version to 2016.05-06
[buildroot-gz.git] / package / gcc / 6.3.0 / 894-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch
blobce49de7ee9b58528203b6184aeda97bf553c68f3
1 From 9d9f97ca5d1ceba66677bf406c9b31027dc1f22e Mon Sep 17 00:00:00 2001
2 From: Waldemar Brodkorb <wbx@openadk.org>
3 Date: Fri, 19 Aug 2016 13:54:46 +0200
4 Subject: [PATCH] libgcc: fix DWARF compilation with FDPIC targets
6 The build of unwind-dw2-fde-dip.c currently fails for FDPIC targets with
7 the following error:
9 libgcc/unwind-dw2-fde-dip.c:167:31: error: storage size of 'load_base' isn't known
10 struct elf32_fdpic_loadaddr load_base;
12 This patch addresses that by defining load_base with the appropriate
13 type on FDPIC targets. It has been tested on FRV and Blackfin.
15 Fixes PR gcc/68468.
17 Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
18 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
19 ---
20 libgcc/unwind-dw2-fde-dip.c | 8 ++++++--
21 1 file changed, 6 insertions(+), 2 deletions(-)
23 diff --git a/libgcc/unwind-dw2-fde-dip.c b/libgcc/unwind-dw2-fde-dip.c
24 index f7a1c3f..801bce8 100644
25 --- a/libgcc/unwind-dw2-fde-dip.c
26 +++ b/libgcc/unwind-dw2-fde-dip.c
27 @@ -124,7 +124,11 @@ static struct frame_hdr_cache_element
29 _Unwind_Ptr pc_low;
30 _Unwind_Ptr pc_high;
31 +#if defined __FRV_FDPIC__ || defined __BFIN_FDPIC__
32 + struct elf32_fdpic_loadaddr load_base;
33 +#else
34 _Unwind_Ptr load_base;
35 +#endif
36 const ElfW(Phdr) *p_eh_frame_hdr;
37 const ElfW(Phdr) *p_dynamic;
38 struct frame_hdr_cache_element *link;
39 @@ -163,7 +167,7 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
40 struct unw_eh_callback_data *data = (struct unw_eh_callback_data *) ptr;
41 const ElfW(Phdr) *phdr, *p_eh_frame_hdr, *p_dynamic;
42 long n, match;
43 -#ifdef __FRV_FDPIC__
44 +#if defined __FRV_FDPIC__ || defined __BFIN_FDPIC__
45 struct elf32_fdpic_loadaddr load_base;
46 #else
47 _Unwind_Ptr load_base;
48 @@ -347,7 +351,7 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
49 break;
52 -# elif defined __FRV_FDPIC__ && defined __linux__
53 +# elif (defined __FRV_FDPIC__ || defined __BFIN_FDPIC__) && defined __linux__
54 data->dbase = load_base.got_value;
55 # else
56 # error What is DW_EH_PE_datarel base on this platform?
57 --
58 2.7.4