How to modify startup (.S) code

I want to add external RAM to the ATMEGA2560, in fact I have already done that - hardwarewise.
Now I want this extra memory to be available for standard programming, not only for dynamically allocated variables on the heap.
As far as I have understood things, I will have to enable the external memory interface in the startup code.
But I cannot find this in the Arduino-realm.
Is it auto-generated by avr-libc?
Are there means to change this code, ideally based on board selection - because I configured a custom board for my mega+xmem to be available via boards manager

Read this
https://andybrown.me.uk/2011/08/28/512kb-sram-expansion-for-the-arduino-mega-design/

That sure is an interesting read, which I had found some time ago while doing my own research, but has nothing to do with the initial question...