-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linker: update section names to be unambiguous #87395
Conversation
cc @dewitt-garmin @GoranWall, would this fix the issue detected in #86999 (comment)? |
Recently 0ae0c3d allowed for three digit priorities, this resulted in objects potentially matching multiple sections, for example: .z_init_PRE_KERNEL_2_0_0_ .z_init_PRE_KERNEL_2_?_* .z_init_PRE_KERNEL_2_???_* This does not seem to be detected by ld, but the IAR linker emits a warning. Add some extra qualifiers in the object section name to make it unambiguous, this has the extra value of making it easier to interpret, for example going from: .z_init_POST_KERNEL_90_00012_ to .z_init_POST_KERNEL_P_90_SUB_00012_ Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
1f4d121
to
23057f4
Compare
@fabiobaltieri the IAR linker doesn't complain with this. |
Good catch. Another option might be to use a character class, [0-9], instead of ? |
Interesting, did not realize the linker supported it, not sure why that hasn't been used in the first place but I feel like it may not be supported by some old release or something like that, though it's used in I think it's worth a try, but maybe let's merge this now to remove the ambiguity issue and consider that for a followup, and then we can revert it separately if something breaks. I like the new symbols names anyway, makes them way more understandable. |
Tagging has hotfix, strictly speaking it does not break the CI, but one may argue that it should. |
There were issues with using |
@pdgendt it's used in here though:
Do you happen to remember the specific issue? |
Do you know what tools could not support this? I just tried [0-9] and all of the ones that twister builds seemed to pass but as we have just seen that apparently is not sufficient. Maybe IAR is also the limitation here? |
Yeah.. These linker wildcards are NOT regexps, even though it seems ld supports a little bit more than we (IAR do)
|
I have a PR to remove that regular expression, as the IAR linker does not support regular expressions. |
Recently 0ae0c3d allowed for three digit priorities, this resulted in objects potentially matching multiple sections, for example:
This does not seem to be detected by ld, but the IAR linker emits a warning.
Add some extra qualifiers in the object section name to make it unambiguous, this has the extra value of making it easier to interpret, for example going from:
.z_init_POST_KERNEL_90_00012_
to
.z_init_POST_KERNEL_P_90_SUB_00012_