[PATCH] D49926: Update split stack support to handle more generic prologues.Improve error handling.Add test file for better code-coverage. Update tests to be morecomplete.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 1 01:07:17 PDT 2018
grimar added inline comments.
================
Comment at: ELF/InputSection.cpp:854
+ error("Mixing split-stack objects requires a definition of "
+ "__more_stack_non_split");
+ return;
----------------
Something is wrong here. You are reporting `__more_stack_nonsplit` symbol name (and in the test cases you are using the same name),
but trying to find the `__morestack_non_split` in the symbol table.
================
Comment at: ELF/InputSection.cpp:928
+ // If the callee's-file was compiled with split stack, nothing to do.
+ auto IS = cast_or_null<InputSection>(D->Section);
+ if (!IS || IS->getFile<ELFT>()->SplitStack)
----------------
I think we usually write like this: `auto *IS =`
================
Comment at: test/ELF/x86-64-split-stack-prologue-adjust-fail.s:9
# An unknown prologue gives a match failure
-# CHECK: unable to adjust the enclosing function's
+# CHECK: x86-64-split-stack-prologue-adjust-fail.s.tmp1.o:(.text): unknown_prologue (with -fsplit-stack) calls non_split (without -fsplit-stack), but couldn't adjust its prologue
----------------
I think we do not rely on the test file name and usually use regexp for checking, example:
`# CHECK: error: {{.*}}.o:(.zdebug_str): decompress failed:`
================
Comment at: test/ELF/x86-64-split-stack-prologue-adjust-fail.s:14
+# RUN: not ld.lld --defsym __morestack=0x100 --defsym _start=0x300 %t1.o %t2.o %t3.o -o %t 2>&1 | FileCheck %s -check-prefix=UNDEFINED_MORE_STACK_NON_SPLIT
+# UNDEFINED_MORE_STACK_NON_SPLIT: Mixing split-stack objects requires a definition of __more_stack_non_split
----------------
Do you need the --defsym here?
I would also rename `UNDEFINED_MORE_STACK_NON_SPLIT` so something a bit shorter. Maybe just `ERROR`?
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D49926
More information about the llvm-commits
mailing list