binutils: drop redundant 'program_name' definition (-fno-common)

Message ID 20200201231611.264009-1-slyfox@gentoo.org
State New
Headers show
Series
  • binutils: drop redundant 'program_name' definition (-fno-common)
Related show

Commit Message

Sergei Trofimovich Feb. 1, 2020, 11:16 p.m.
From: Sergei Trofimovich <siarheit@google.com>


On gcc-10 (and gcc-9 -fno-common) --enable-targets=all build fails as:
```
libtool: link: gcc ... -o srconv srconv.o bucomm.o ...
ld: bucomm.o:(.bss+0x0):
  multiple definition of `program_name'; srconv.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:942: srconv] Error 1
```

	* binutils/coffdump.c (program_name): drop redundant definition.
	* binutils/srconv.c (program_name): drop redundant definition.
	* binutils/sysdump.c (program_name): drop redundant definition.

Signed-off-by: Sergei Trofimovich <siarheit@google.com>

---
 binutils/ChangeLog  | 6 ++++++
 binutils/coffdump.c | 2 --
 binutils/srconv.c   | 2 --
 binutils/sysdump.c  | 2 --
 4 files changed, 6 insertions(+), 6 deletions(-)

-- 
2.25.0

Comments

Alan Modra Feb. 3, 2020, 5:30 a.m. | #1
On Sat, Feb 01, 2020 at 11:16:11PM +0000, Sergei Trofimovich wrote:
> From: Sergei Trofimovich <siarheit@google.com>

> 

> On gcc-10 (and gcc-9 -fno-common) --enable-targets=all build fails as:

> ```

> libtool: link: gcc ... -o srconv srconv.o bucomm.o ...

> ld: bucomm.o:(.bss+0x0):

>   multiple definition of `program_name'; srconv.o:(.bss+0x0): first defined here

> collect2: error: ld returned 1 exit status

> make[4]: *** [Makefile:942: srconv] Error 1

> ```

> 

> 	* binutils/coffdump.c (program_name): drop redundant definition.

> 	* binutils/srconv.c (program_name): drop redundant definition.

> 	* binutils/sysdump.c (program_name): drop redundant definition.


Applied.

-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 222ea7af4b..20d13c4bc8 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@ 
+2020-02-01  Sergei Trofimovich  <siarheit@google.com>
+
+	* binutils/coffdump.c (program_name): drop redundant definition.
+	* binutils/srconv.c (program_name): drop redundant definition.
+	* binutils/sysdump.c (program_name): drop redundant definition.
+
 2020-02-01  Nick Clifton  <nickc@redhat.com>
 
 	* README-how-to-make-a-release: Update with more details on the
diff --git a/binutils/coffdump.c b/binutils/coffdump.c
index 531a4e46c3..336da57ca2 100644
--- a/binutils/coffdump.c
+++ b/binutils/coffdump.c
@@ -456,8 +456,6 @@  coff_dump (struct coff_ofile *ptr)
     dump_coff_section (ptr->sections + i);
 }
 
-char * program_name;
-
 static void
 show_usage (FILE *file, int status)
 {
diff --git a/binutils/srconv.c b/binutils/srconv.c
index 5742b16759..f071794f0a 100644
--- a/binutils/srconv.c
+++ b/binutils/srconv.c
@@ -1687,8 +1687,6 @@  prescan (struct coff_ofile *otree)
     }
 }
 
-char *program_name;
-
 ATTRIBUTE_NORETURN static void
 show_usage (FILE *ffile, int status)
 {
diff --git a/binutils/sysdump.c b/binutils/sysdump.c
index d433e71ed9..7eebbd61d3 100644
--- a/binutils/sysdump.c
+++ b/binutils/sysdump.c
@@ -633,8 +633,6 @@  module (void)
     }
 }
 
-char *program_name;
-
 ATTRIBUTE_NORETURN static void
 show_usage (FILE *ffile, int status)
 {