Stop the linker from accepting executable ELF files as inputs to other links.
PR 26047 * ldelf.c (ldelf_after_open): Fail if attempting to link one executable into another.
This commit is contained in:
parent
44486dcf19
commit
a3fc941881
@ -1,3 +1,9 @@
|
||||
2020-05-28 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR 26047
|
||||
* ldelf.c (ldelf_after_open): Fail if attempting to link one
|
||||
executable into another.
|
||||
|
||||
2020-05-28 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* NEWS: Mention --enable-textrel-check=yes is default for
|
||||
|
@ -1065,6 +1065,13 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
|
||||
{
|
||||
int type = 0;
|
||||
|
||||
if (bfd_link_executable (& link_info)
|
||||
&& elf_tdata (abfd)->elf_header->e_type == ET_EXEC)
|
||||
{
|
||||
einfo (_("%F%P: cannot use executable file '%pB' as input to a link\n"),
|
||||
abfd);
|
||||
}
|
||||
|
||||
if (bfd_input_just_syms (abfd))
|
||||
continue;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user