Trevor Scroggins <trevor.scrogg...@gmail.com> writes:

> No, that won't work. The assembler only recognizes .text, .data, and
> .bss and doesn't support .section. Surely there's a simple hook that
> instructs that compiler to print locals after a function instead of
> before it?

No.  Why should there be?  Even if you fix the case of string constants,
you will run into trouble as soon as somebody writes
    const int ai[] = { 1 };

Most systems require some sort of startup code to run before main,
anyhow.  If you have no such requirement, then I recommend simply being
disciplined in how you write the "main" function, or paying the cost of
two or four initial bytes to branch to the main function from the start
of the .text section.

Ian

Reply via email to