diff options
-rw-r--r-- | lld/ELF/Writer.cpp | 3 | ||||
-rw-r--r-- | lld/test/ELF/execute-only-mixed-data.s | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index b50126024a1..1962e7c20de 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -1759,7 +1759,8 @@ template <class ELFT> void Writer<ELFT>::checkExecuteOnly() { if (OS->Flags & SHF_EXECINSTR) for (InputSection *IS : getInputSections(OS)) if (!(IS->Flags & SHF_EXECINSTR)) - error("-execute-only does not support intermingling data and code"); + error("cannot place " + toString(IS) + " into " + toString(OS->Name) + + ": -execute-only does not support intermingling data and code"); } // The linker is expected to define SECNAME_start and SECNAME_end diff --git a/lld/test/ELF/execute-only-mixed-data.s b/lld/test/ELF/execute-only-mixed-data.s index 6ef62368123..b57695493dd 100644 --- a/lld/test/ELF/execute-only-mixed-data.s +++ b/lld/test/ELF/execute-only-mixed-data.s @@ -16,7 +16,7 @@ // RUN: }" > %t.lds // RUN: ld.lld -T%t.lds %t.o -o %t -execute-only 2>&1 -// CHECK: -execute-only does not support intermingling data and code +// CHECK: cannot place {{.*}}:(.rodata.foo) into .text: -execute-only does not support intermingling data and code br lr |