From 83b1d8f4a69ab5803ae33e05dcf14d8f26848ff2 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sat, 19 Jun 2021 16:33:24 -0700 Subject: elf: Correct DT_TEXTREL warning in PDE Change ld: warning: creating DT_TEXTREL in a PIE to ld: warning: creating DT_TEXTREL in a PDE on PDE. bfd/ * elflink.c (bfd_elf_final_link): Correct DT_TEXTREL warning in PDE. ld/ * testsuite/ld-x86-64/textrel-1.err: New file. * testsuite/ld-x86-64/textrel-1a.s: Likewise. * testsuite/ld-x86-64/textrel-1b.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run textrel-1 tests. --- bfd/elflink.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bfd/elflink.c') diff --git a/bfd/elflink.c b/bfd/elflink.c index c9a6e78be79..9a05208253c 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -13138,6 +13138,9 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) else if (bfd_link_dll (info)) info->callbacks->einfo (_("%P: warning: creating DT_TEXTREL in a shared object\n")); + else if (bfd_link_pde (info)) + info->callbacks->einfo + (_("%P: warning: creating DT_TEXTREL in a PDE\n")); else info->callbacks->einfo (_("%P: warning: creating DT_TEXTREL in a PIE\n")); -- cgit v1.2.3-65-gdbad