gcc: remove Blackfin patches
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
parent
0cd6d15a20
commit
177a2a8076
@ -1,60 +0,0 @@
|
||||
From ae9c3e354440c4a0f105a9eabfb2f77be085ebc1 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
Date: Thu, 18 Aug 2016 17:59:16 +0200
|
||||
Subject: [PATCH] libgcc/mkmap-symver: support skip_underscore
|
||||
|
||||
Some platforms, such as Blackfin, have a special prefix for assembly
|
||||
symbols as opposed to C symbols. For this reason, a function named
|
||||
"foo()" in C will in fact be visible as a symbol called "_foo" in the
|
||||
ELF binary.
|
||||
|
||||
The current linker version script logic in libgcc doesn't take into
|
||||
account this situation properly. The Blackfin specific
|
||||
libgcc/config/bfin/libgcc-glibc.ver has an additional "_" in front of
|
||||
every symbol so that it matches the output of "nm" (which gets parsed to
|
||||
produce the final linker version script). But due to this additional
|
||||
"_", ld no longer matches with the symbols since "ld" does the matching
|
||||
with the original symbol name, not the one prefixed with "_".
|
||||
|
||||
Due to this, none of the symbols in libgcc/config/bfin/libgcc-glibc.ver
|
||||
are actually matched with symbols in libgcc. This causes all libgcc
|
||||
symbols to be left as "LOCAL", which causes lots of "undefined
|
||||
reference" whenever some C or C++ code that calls a function of libgcc
|
||||
is compiled.
|
||||
|
||||
To address this, this commit introduces a "skip_underscore" variable to
|
||||
the mkmap-symver script. It tells mkmap-symver to ignore the leading
|
||||
underscore from the "nm" output.
|
||||
|
||||
Note that this new argument is different from the existing
|
||||
"leading_underscore" argument, which *adds* an additional underscore to
|
||||
the generated linker version script.
|
||||
|
||||
Having this functionality paves the way to using the generic linker
|
||||
version information for Blackfin, instead of using a custom one.
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
---
|
||||
libgcc/mkmap-symver.awk | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libgcc/mkmap-symver.awk b/libgcc/mkmap-symver.awk
|
||||
index 266832a..30bb179 100644
|
||||
--- a/libgcc/mkmap-symver.awk
|
||||
+++ b/libgcc/mkmap-symver.awk
|
||||
@@ -47,7 +47,11 @@ state == "nm" && ($1 == "U" || $2 == "U") {
|
||||
|
||||
state == "nm" && NF == 3 {
|
||||
split ($3, s, "@")
|
||||
- def[s[1]] = 1;
|
||||
+ if (skip_underscore)
|
||||
+ symname = substr(s[1], 2);
|
||||
+ else
|
||||
+ symname = s[1];
|
||||
+ def[symname] = 1;
|
||||
sawsymbol = 1;
|
||||
next;
|
||||
}
|
||||
--
|
||||
2.7.4
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,59 +0,0 @@
|
||||
From 9d9f97ca5d1ceba66677bf406c9b31027dc1f22e Mon Sep 17 00:00:00 2001
|
||||
From: Waldemar Brodkorb <wbx@openadk.org>
|
||||
Date: Fri, 19 Aug 2016 13:54:46 +0200
|
||||
Subject: [PATCH] libgcc: fix DWARF compilation with FDPIC targets
|
||||
|
||||
The build of unwind-dw2-fde-dip.c currently fails for FDPIC targets with
|
||||
the following error:
|
||||
|
||||
libgcc/unwind-dw2-fde-dip.c:167:31: error: storage size of 'load_base' isn't known
|
||||
struct elf32_fdpic_loadaddr load_base;
|
||||
|
||||
This patch addresses that by defining load_base with the appropriate
|
||||
type on FDPIC targets. It has been tested on FRV and Blackfin.
|
||||
|
||||
Fixes PR gcc/68468.
|
||||
|
||||
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
---
|
||||
libgcc/unwind-dw2-fde-dip.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/libgcc/unwind-dw2-fde-dip.c b/libgcc/unwind-dw2-fde-dip.c
|
||||
index f7a1c3f..801bce8 100644
|
||||
--- a/libgcc/unwind-dw2-fde-dip.c
|
||||
+++ b/libgcc/unwind-dw2-fde-dip.c
|
||||
@@ -124,7 +124,11 @@ static struct frame_hdr_cache_element
|
||||
{
|
||||
_Unwind_Ptr pc_low;
|
||||
_Unwind_Ptr pc_high;
|
||||
+#if defined __FRV_FDPIC__ || defined __BFIN_FDPIC__
|
||||
+ struct elf32_fdpic_loadaddr load_base;
|
||||
+#else
|
||||
_Unwind_Ptr load_base;
|
||||
+#endif
|
||||
const ElfW(Phdr) *p_eh_frame_hdr;
|
||||
const ElfW(Phdr) *p_dynamic;
|
||||
struct frame_hdr_cache_element *link;
|
||||
@@ -163,7 +167,7 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
|
||||
struct unw_eh_callback_data *data = (struct unw_eh_callback_data *) ptr;
|
||||
const ElfW(Phdr) *phdr, *p_eh_frame_hdr, *p_dynamic;
|
||||
long n, match;
|
||||
-#ifdef __FRV_FDPIC__
|
||||
+#if defined __FRV_FDPIC__ || defined __BFIN_FDPIC__
|
||||
struct elf32_fdpic_loadaddr load_base;
|
||||
#else
|
||||
_Unwind_Ptr load_base;
|
||||
@@ -347,7 +351,7 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
|
||||
break;
|
||||
}
|
||||
}
|
||||
-# elif defined __FRV_FDPIC__ && defined __linux__
|
||||
+# elif (defined __FRV_FDPIC__ || defined __BFIN_FDPIC__) && defined __linux__
|
||||
data->dbase = load_base.got_value;
|
||||
# else
|
||||
# error What is DW_EH_PE_datarel base on this platform?
|
||||
--
|
||||
2.7.4
|
||||
|
@ -1,17 +0,0 @@
|
||||
enable _REENTRANT when -lpthread is used
|
||||
|
||||
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
|
||||
|
||||
diff -Nur gcc-6.2.0.orig/gcc/config/bfin/linux.h gcc-6.2.0/gcc/config/bfin/linux.h
|
||||
--- gcc-6.2.0.orig/gcc/config/bfin/linux.h 2016-01-04 15:30:50.000000000 +0100
|
||||
+++ gcc-6.2.0/gcc/config/bfin/linux.h 2016-09-30 20:48:17.446636819 +0200
|
||||
@@ -38,6 +38,9 @@
|
||||
"%{static:--start-group} %{mfast-fp:-lbffastfp} %G %L %{static:--end-group} \
|
||||
%{!static:%{mfast-fp:-lbffastfp} %G}"
|
||||
|
||||
+#undef CPP_SPEC
|
||||
+#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
|
||||
+
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC "\
|
||||
%{mfdpic: -m elf32bfinfd -z text} %{shared} %{pie} \
|
Loading…
Reference in New Issue
Block a user