[PATCH] D36874: [ELF] - Mention "-z notext" and -fPIC in some error messages
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 18 16:04:02 PDT 2017
ruiu added inline comments.
================
Comment at: test/ELF/dynamic-reloc-in-ro.s:5-10
+// CHECK: can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment
+// CHECK-NEXT: >>> defined in {{.*}}.o
+// CHECK-NEXT: >>> referenced by {{.*}}.o:(.text+0x0)
+// CHECK-NEXT: >>> Usually this error happens when -fPIC flag is missing during compilation.
+// CHECK-NEXT: >>> Unintentional use of such relocations is undesirable, and not
+// CHECK-NEXT: >>> permited by default, consider using -z notext.
----------------
This error message style is not desirable, as two list elements ("defined in ..." and "referenced by ..." and the description text "Usually ..." are in the same list. That is just like this
Found an error
- at file foo.c
- on line 100
- Usually this error happens when you made a mistake blah blah
and I believe you can see why this is wrong.
I also wonder if you really want to mention `-z notext`. We want to recommend or endorse the option because we want to avoid text relocations in general. In most cases, you just need to compile object files with -fPIC, so I believe you want to mention only that.
Overall, I'd change the message to "can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment; recompile object files with -fPIC to fix this error".
https://reviews.llvm.org/D36874
More information about the llvm-commits
mailing list