DavidSpickett wrote:

My first instinct with this sort of `if arch is bla` code is to put it into a 
plugin, usually the ABI. However this being ELF specific, and the ELF plugin 
not having access to a target to get the ABI from, that's not possible. The 
DYLD plugin could but then we still have 2 copies of the symbol prefixes. So 
same result really.

The ELF plugin function is already 300 lines of architecture details so this is 
not unique to trampolines at all.

If someone wanted to add trampolines for MachO, they would need to add them to 
the MachO plugin and the list in DYLD so the DYLD list is going to end up a 
superset of them anyway. So there will always be one larger list, with subsets 
of it in the different object type plugins.

The fact that DYLD might look for suffixes for ELF in a MachO file should not 
be a problem (at least for correctness) because a symbol with an ELF thunk 
suffix name would not be marked as a thunk symbol by the MachO object plugin in 
the first place.

So no need to change the structure of this PR, but do correct me if any of my 
assumptions are incorrect there.

https://github.com/llvm/llvm-project/pull/90783
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to