]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - ld/ldfile.c
Re: Have the linker report an error if the same script is used twice
authorAlan Modra <amodra@gmail.com>
Thu, 23 May 2019 00:52:56 +0000 (10:22 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 23 May 2019 01:08:45 +0000 (10:38 +0930)
commit82d7a6f4e3ccb3d714b5beb03eeb24f7356d4380
tree001d46dd795e917b33750563ea5e95bc3eb5e1e8
parent016181423bff8c04b2808f2dca9a95f0c9d92fe5
Re: Have the linker report an error if the same script is used twice

git commit 6ec6968b1b2 results in
... error: linker script file '/usr/local/lib64/libgcc_s.so' appears multiple times
collect2: error: ld returned 1 exit status
FAIL: bootstrap

This patch changes things so that an error is given only when a -T
script or the default script is invoked more than once.  I'm still a
little nervous that we match script file names, not the entire path.

PR 24576
* ldfile.c (enum script_open_style): New.
(struct script_name_list): New.
(ldfile_open_command_file_1): Take a script_open_style param
rather than booleans.  Adjust callers.  Only fail when -T or
default -T script is invoked twice.
(ldfile_try_open_bfd): Revert last change.
ld/ChangeLog
ld/ldfile.c