ld: fix build with old glibc / gcc

Message ID d8cb6772-092f-b79e-421b-1da61ce020ac@suse.com
State Unresolved
Headers
Series ld: fix build with old glibc / gcc |

Checks

Context Check Description
snail/binutils-gdb-check warning Git am fail log

Commit Message

Jan Beulich July 7, 2023, 12:01 p.m. UTC
  "rename" conflicts with a function of that name, which gcc from that
same timeframe then complains about. Use a name matching that of
struct input_remap's respective field.
---
Nick, I expect this also wants to go on the branch.
  

Comments

Nick Clifton July 7, 2023, 12:09 p.m. UTC | #1
Hi Jan,

> "rename" conflicts with a function of that name, which gcc from that
> same timeframe then complains about. Use a name matching that of
> struct input_remap's respective field.
> ---
> Nick, I expect this also wants to go on the branch.

It does.  I have updated the branch.  Please can I leave the master
source update to you ?

Cheers
   Nick
  
Jan Beulich July 7, 2023, 12:12 p.m. UTC | #2
On 07.07.2023 14:09, Nick Clifton wrote:
>> "rename" conflicts with a function of that name, which gcc from that
>> same timeframe then complains about. Use a name matching that of
>> struct input_remap's respective field.
>> ---
>> Nick, I expect this also wants to go on the branch.
> 
> It does.  I have updated the branch.  Please can I leave the master
> source update to you ?

Sure, already done.

Jan
  

Patch

--- a/ld/ldfile.c
+++ b/ld/ldfile.c
@@ -199,7 +199,7 @@  ldfile_add_remap_file (const char * file
 	  continue;
 	}
 
-      char * rename = p;
+      char * renamed = p;
 
       /* Advance past the rename entry.  */
       while (*p && *p != '=' && *p != ' ' && *p != '\t' && *p != '\f'
@@ -208,7 +208,7 @@  ldfile_add_remap_file (const char * file
       /* And terminate it.  */
       *p = '\0';
 
-      ldfile_add_remap (pattern, rename);
+      ldfile_add_remap (pattern, renamed);
     }
   while (! feof (f));