Please note: We are aware of an issue affecting replies on the Arm Community forums, which may not be loading as expected.

We apologize for any inconvenience and appreciate your patience while we investigate and work to resolve the issue.

Thank you for your understanding.


This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

.rodata alignment

I'm using gcc on 64-bit Raspberry Pi OS. It gives me doubleword alignment for text strings:

        .text
        .section        .rodata
        .align  3
.LC0:
        .string "Enter one character: "
        .align  3
.LC1:
        .string "You entered: "
        .text
        .align  2
        .global main
        .type   main, %function
main:
I understand the reason for word alignment for the .text. But the documentation says that pointer alignment should be that of the element. The element of a text string is a byte, so why are they using doubleword alignment?