There are two usages of AvailableExternally Linkage.
The first one is used for inlining of thunks under the Itanium ABI. However, this linkage set on thunks is a temporary presence and is never ended up in the final IR. So we don't need to take care of it in the backend.
The second one is where we have a const declaration with an initializer, we may be able to emit it as available_externally to expose its value to the optimizer. Since on AIX, our strategy is to not use -u to suppress any undefined symbols, we need to emit .extern for the symbol.
I think we look AvailableExternallyLinkage as AvailableExternallyLinkage
you can change as
and we do not need code
here.