[PATCH] D139024: [Backend][AsmPrinter][CFI] Generate unwind table entries in .eh_frame when the uwtable attribute is present.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 17 12:35:54 PST 2022


MaskRay added a comment.

In D139024#3988513 <https://reviews.llvm.org/D139024#3988513>, @jmmartinez wrote:

> Hi ! Thanks for the comment (and sorry for the delay).
>
> In D139024#3969663 <https://reviews.llvm.org/D139024#3969663>, @MaskRay wrote:
>
>> Can you describe the clang command line?
>
> The objective is to emit an entry in the `.eh_frame` section when the function is marked as `uwtable` (and CFI is supported by the target).
> This is used by sanitizers that use async unwind tables (address, hwaddress, thread, memory and dataflow according to https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/SanitizerArgs.cpp#L42, and used here https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/Clang.cpp#L5395).
>
> Then, when `-fsanitize=address` is used, `clang` would pass the `-funwind-tables=2` flag to the `clang -cc1` process. Then, every function definition coming clang's code-generation should have the `uwtable` attribute.

`-fsanitize=address` used to need unwind tables for error reporting. It no longer does after https://reviews.llvm.org/D102046

> In D139024#3969663 <https://reviews.llvm.org/D139024#3969663>, @MaskRay wrote:
>
>> The change modifies the ExceptionHandling::None behavior for AMDGPU's own use case, which may not be desired by other ExceptionHandling::None targets.
>
> I do agree that this may affect other targets, but I thought that it could affect them in a positive way (the uwtable forces the emission of an entry in the uwtable as it says it does). I might be misinterpreting the uwtable attribute.

I am still unclear what you want to do. A `.c` source with a command line in the commit message will help, though I guess this patch may not be needed at all.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139024/new/

https://reviews.llvm.org/D139024



More information about the llvm-commits mailing list