diff options
author | Jörg Krause <joerg.krause@embedded.rocks> | 2017-07-10 14:29:41 +0200 |
---|---|---|
committer | Peter Korsgaard <peter@korsgaard.com> | 2017-07-11 22:17:12 +0200 |
commit | 1a405ea56d5240832df10c5491cecc13efbb0b2d (patch) | |
tree | c2b507aab96c26aacb125593089f8025f3762aaf /package/gcc/6.4.0/892-libgcc-mkmap-symver-support-skip_underscore.patch | |
parent | 2ab924213d3d50b176f1b8efaecb5fcaef28dae4 (diff) | |
download | buildroot-1a405ea56d5240832df10c5491cecc13efbb0b2d.tar.gz buildroot-1a405ea56d5240832df10c5491cecc13efbb0b2d.zip |
gcc: bump 6.x series to version 6.4.0
Drop the following patches:
* the Xtensa patches 870 and 871 are upstream now
* patch 942 was backported to GCC 6 branch
Note, that a bz2 release tarball is not provided anymore and is replaced by
a xz tarball file.
Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/gcc/6.4.0/892-libgcc-mkmap-symver-support-skip_underscore.patch')
-rw-r--r-- | package/gcc/6.4.0/892-libgcc-mkmap-symver-support-skip_underscore.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/package/gcc/6.4.0/892-libgcc-mkmap-symver-support-skip_underscore.patch b/package/gcc/6.4.0/892-libgcc-mkmap-symver-support-skip_underscore.patch new file mode 100644 index 0000000000..73ee6c5faa --- /dev/null +++ b/package/gcc/6.4.0/892-libgcc-mkmap-symver-support-skip_underscore.patch @@ -0,0 +1,60 @@ +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 + |