GNU assembler .macro directive does not expand fully
How can I get the .macro directive to faithfully reproduce desired contents?
I have the following macro defined:
.macro Insert_Function Routine
.weak \Routine
.type \Routine, %function
\Routine :
B .
.size \Routine, . - \Routine
.endm
And it in the same file is used as:
Insert_Function NMI_Handler
/* ================= */
Insert_Function HardFault_Handler
/* ================= */
The following is the output extracted from the list file:
Insert_Function NMI_Handler
10001172: e7fe b.n 10001172 <NMI_Handler>
10001174 <HardFault_
/* ================== */
Insert_Function HardFault_Handler
10001174: e7fe b.n 10001174 <HardFault_Handler>
10001176 <SVC_Handler>:
/* ================== */
There are two problems with this listing.
1. The .weak and .type attributes are not reproduced
2. The succeeding label is inexplicably considered alongside the current label space.
For example, HardFault_Handler label is seen in NMI_Handler listing while SVC_Handler label can be seen in HardFault_Handler listing. Although addresses assigned to the labels are correct and non-overlapping
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Joey Ye
- Solved:
- Last query:
- Last reply: