[PATCH] Add an option to allow JumpInstrTables to set unnamed_addr and jumptable on all address-taken functions

Tom Roeder tmroeder at google.com
Tue Jun 24 16:22:19 PDT 2014


On Tue, Jun 24, 2014 at 12:00 PM, Tom Roeder <tmroeder at google.com> wrote:
> On Mon, Jun 23, 2014 at 12:18 PM, Nick Lewycky <nicholas at mxc.ca> wrote:
>> Tom Roeder wrote:
>>> I don't see why this should have anything to do with a front end
>>> component, though it might make sense eventually to have a high-level
>>> flag like that in clang that sets a lower-level flag. Currently, I
>>> just pass flags directly to LTO through clang with
>>>
>>> -Wl,--plugin-opt=-jump-table-type=arity
>>
>>
>> Mostly I want to have a single place to decide whether we're going to do the
>> jump table transform or not. The reason it goes in the frontend is because
>> it actually changes language semantics, the frontend may want to emit
>> different IR, or may want to warn the user that "&func1 == my_funcptr" isn't
>> going to work when CFI is on. If you did have it in the frontend, I don't
>> see why you would also need a plugin option.
>
> That makes sense; I'll look into it.

It looks fairly straightfoward to add the option in clang; however,
after thinking about it some more, I think that even with a frontend
option, there still needs to be a way to trigger CFI from the back end
directly, since there needs to be some way to write CFI regression
tests in LLVM directly without using clang.



More information about the llvm-commits mailing list