aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/ldelf.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 7ae7613..2d130b4 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2021-06-11 Alan Modra <amodra@gmail.com>
+
+ PR 27952
+ * ldelf.c (ldelf_after_open): Error on input PIEs too.
+
2021-06-09 Nick Clifton <nickc@redhat.com>
PR 27666
diff --git a/ld/ldelf.c b/ld/ldelf.c
index 4d4d9ca..21e655b 100644
--- a/ld/ldelf.c
+++ b/ld/ldelf.c
@@ -1048,7 +1048,9 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
&& elf_tdata (abfd) != NULL
&& elf_tdata (abfd)->elf_header != NULL
/* FIXME: Maybe check for other non-supportable types as well ? */
- && elf_tdata (abfd)->elf_header->e_type == ET_EXEC)
+ && (elf_tdata (abfd)->elf_header->e_type == ET_EXEC
+ || (elf_tdata (abfd)->elf_header->e_type == ET_DYN
+ && elf_tdata (abfd)->is_pie)))
einfo (_("%F%P: cannot use executable file '%pB' as input to a link\n"),
abfd);
}