-
-
Couldn't load subscription status.
- Fork 179
Description
Currently SECTION FRAGMENTs are placed by the linker in the order of the input arguments. This can cause subtle breakage if a build tool like make reorders the files. My suggestion is a priority parameter which can be used to describe the order of SECTION FRAGMENTs using only the file contents, and not having to rely on forcing a certain parameter order by for example requiring alphabetically sorted file names and using sort to set the order explicitly.
The feature could have an integer argument, where a SECTION FRAGMENT with a lower argument will always be inserted before one with a higher argument.
The use case where this came up is code that starts in one SECTION FRAGMENT, runs to the end and then resumes in a different SECTION FRAGMENT in a different file. An example of how the proposed feature might work:
file1.asm:
SECTION FRAGMENT[0] "Stuff", ROMX
DoSomeStuff::
; Stuff is being done
file2.asm:
SECTION FRAGMENT[10] "Stuff", ROMX
; Do some cleanup
ret