From 3dfaaa0ec2ba2a169210f0a580dd03d95c9a0207 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 8 Dec 2017 11:11:14 +0000 Subject: [PATCH] Invent an input filename when reading from a pipe. Resolves: #1523401 --- annobin-empty-input-filename.patch | 19 +++++++++++++++++++ annobin.spec | 15 ++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 annobin-empty-input-filename.patch diff --git a/annobin-empty-input-filename.patch b/annobin-empty-input-filename.patch new file mode 100644 index 0000000..ab2de3c --- /dev/null +++ b/annobin-empty-input-filename.patch @@ -0,0 +1,19 @@ +Binary files annobin.orig/.git/index and annobin-2.5.1/.git/index differ +diff -rup annobin.orig/plugin/annobin.cc annobin-2.5.1/plugin/annobin.cc +--- annobin.orig/plugin/annobin.cc 2017-12-08 10:57:16.555154143 +0000 ++++ annobin-2.5.1/plugin/annobin.cc 2017-12-08 11:00:15.105903652 +0000 +@@ -103,6 +103,14 @@ init_annobin_current_filename (void) + return; + + name = (char *) lbasename (main_input_filename); ++ ++ if (strlen (name) == 0) ++ { ++ /* The name can be empty if we are receiving the source code ++ from a pipe. In this case, we invent our own name. */ ++ name = "piped_input"; ++ } ++ + if (global_file_name_symbols) + name = strcpy ((char *) xmalloc (strlen (name) + 20), name); + else diff --git a/annobin.spec b/annobin.spec index 07dce4a..dbb74fe 100644 --- a/annobin.spec +++ b/annobin.spec @@ -1,7 +1,7 @@ Name: annobin Summary: Binary annotation plugin for GCC Version: 2.5.1 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv3+ URL: https://fedoraproject.org/wiki/Toolchain/Watermark @@ -11,9 +11,19 @@ URL: https://fedoraproject.org/wiki/Toolchain/Watermark #--------------------------------------------------------------------------------- Source: https://nickc.fedorapeople.org/annobin-%{version}.tar.xz +# For the latest sources use: git clone git://sourceware.org/git/annobin.git +# Purpose: Fixes the generation of illegal assembler symbol names when +# working with unmangled function names. +# Lifetime: Fixed in 2.5.2 Patch1: funname.patch +# Purpose: Fixes a bug where an empty string would be used as an assembler +# symbol name because the source input was being read from a pipe. +# Lifetime: Fixed in 2.5.2 +Patch2: annobin-empty-input-filename.patch + + # This is a gcc plugin, hence gcc is required. Requires: gcc @@ -71,6 +81,9 @@ make check #--------------------------------------------------------------------------------- %changelog +* Fri Dec 08 2017 Florian Weimer - 2.5.1-4 +- Invent an input filename when reading from a pipe. (#1523401) + * Thu Nov 30 2017 Florian Weimer - 2.5.1-3 - Use DECL_ASSEMBLER_NAME for symbol references (#1519165)