Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

junk at end of line, first unrecognized character is `a' while defining a variable in assembly (arm64, gcc)

While defining a variable in a section like this,

.section ".__mydebug", "aw"
mydstart:   .double 0x123456789abcdef0
myptr:  .double 0x8888888899999999

I get

arch/arm64/kernel/head.S:994: Error: junk at end of line, first unrecognized character is `a'

If I change 0x123456789abcdef0 to 0x1234567890000000, it compiles ok. So it seems the compiler (gcc) doesn’t understand the hex chanaracters. I tried 0x123456789ABCDEF0 but it’s the same error starting from A. How can I do this?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

.double is for assembling floating-point values.

If you want the 64-bit integer 0x123456789abcdef0, use .dword or .xword or .8byte.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading