Closed DanielKristofKiss closed 8 months ago
Some points aren't clear in the text:
default
name mangling happen only with FMV enabled or globally?default
one, either explicitly with the attribute or implictly without the attribute, will the new mangling still take place?Some points aren't clear in the text:
- Will this new
default
name mangling happen only with FMV enabled or globally?
Only when FMV enabled. By amending the default
version with "default"
the basename could be used by the resolved symbol, referenced externally as it won't collide with the default function.
- If the only version specified is the
default
one, either explicitly with the attribute or implictly without the attribute, will the new mangling still take place?
Depends on, for the same as above reasons. if the toolchain can avoid emitting redirections then no need to use the default version. maybe a alias could be useful.
I don't understand the remark about aliases in this change. Is this saying that the compiler can optimise versions with identical function bodies to a single function with additional aliased names? If so, I don't think that's relevant to this spec. Alternatively, is it referring to a case where a non-default version specifies only features that the compiler is already assuming to be present?
Aside from that, I think the mangling changes are reasonable. It might be worth adding an explicit remark that the versioned symbol (i.e. the one that is resolved to one of the versions) should have the same mangling as would be used if the function didn't use function multiversioning.
I don't understand the remark about aliases in this change. Is this saying that the compiler can optimise versions with identical function bodies to a single function with additional aliased names? If so, I don't think that's relevant to this spec. Alternatively, is it referring to a case where a non-default version specifies only features that the compiler is already assuming to be present?
The intention is to be sure all function names remain always available when the certain optimisation eliminates a version. (e.g. the default and a given version got merged).
Aside from that, I think the mangling changes are reasonable. It might be worth adding an explicit remark that the versioned symbol (i.e. the one that is resolved to one of the versions) should have the same mangling as would be used if the function didn't use function multiversioning.
ACK.
This looks good to me now. I've already implemented this mangling in GCC.
The default version's name to be mangled to avoid problems with ifuncs due to the ifunc to be called as the base name of the function.
As for any pull request, please make sure to go through the below checklist.
Checklist: (mark with
X
those which apply)SPDX-FileCopyrightText
lines on top of any file I have edited. Format isSPDX-FileCopyrightText: Copyright {year} {entity or name} <{contact informations}>
(Please update existing copyright lines if applicable. You can specify year ranges with hyphen , as in2017-2019
, and use commas to separate gaps, as in2018-2020, 2022
).Copyright
section of the sources of the specification I have edited (this will show up in the text rendered in the PDF and other output format supported). The format is the same described in the previous item.draftversion
is set totrue
in the YAML header of the sources of the specifications I have modified.