Skip to content
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

Cortex-M inline assembly: labels with unique number appended #7649

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

SparkiDev
Copy link
Contributor

Description

When functions are inlined, the labels need to be unique. Putting '%=' on the end of the label ensures that the compilers appends a unique number to the end.

Fixes #7645

Testing

./configure '--disable-shared' 'LDFLAGS=--static' '--host=armv7m' 'CC=arm-linux-gnueabi-gcc' '--enable-sp' '--enable-sp-asm' '--enable-armasm=inline' 'host_alias=armv7m'

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

When functions are inlined, the labels need to be unique.
Putting '%=' on the end of the label ensures that the compilers appends
a unique number to the end.
@@ -101,7 +101,7 @@ void Transform_Sha256_Len(wc_Sha256* sha256, const byte* data, word32 len)
"STRD r10, r11, [sp, #88]\n\t"
/* Start of loop processing a block */
"\n"
"L_SHA256_transform_len_begin:\n\t"
"L_SHA256_transform_len_begin%=:\n\t"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you confirmed this works with compilers like IAR? Let me know if you need some help testing that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't checked IAR and would really appreciate it if you could try it out!

@dgarske dgarske self-assigned this Jun 17, 2024
Copy link

@DGA45 DGA45 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested OK on keil uVision ARM Compiler v6.22 with option -Oz

Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IAR ARM 9.50.1 is happy with the new syntax.

@dgarske dgarske merged commit 71be652 into wolfSSL:master Jun 18, 2024
117 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants