Invent an input filename when reading from a pipe.

Resolves: #1523401
This commit is contained in:
Nick Clifton 2017-12-08 11:11:14 +00:00
parent a11e44bf67
commit 3dfaaa0ec2
2 changed files with 33 additions and 1 deletions

View File

@ -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

View File

@ -1,7 +1,7 @@
Name: annobin Name: annobin
Summary: Binary annotation plugin for GCC Summary: Binary annotation plugin for GCC
Version: 2.5.1 Version: 2.5.1
Release: 3%{?dist} Release: 4%{?dist}
License: GPLv3+ License: GPLv3+
URL: https://fedoraproject.org/wiki/Toolchain/Watermark 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 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 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. # This is a gcc plugin, hence gcc is required.
Requires: gcc Requires: gcc
@ -71,6 +81,9 @@ make check
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
%changelog %changelog
* Fri Dec 08 2017 Florian Weimer <fweimer@redhat.com> - 2.5.1-4
- Invent an input filename when reading from a pipe. (#1523401)
* Thu Nov 30 2017 Florian Weimer <fweimer@redhat.com> - 2.5.1-3 * Thu Nov 30 2017 Florian Weimer <fweimer@redhat.com> - 2.5.1-3
- Use DECL_ASSEMBLER_NAME for symbol references (#1519165) - Use DECL_ASSEMBLER_NAME for symbol references (#1519165)