Using information from customizeReadPowerOnButtons()

In my application I’m trying to use different information stored during startup. The function customizeReadPowerOnButtons() seems to be made so that it stores exactly the information I need. I need information from both SSR about boot cause and I need some information about initial state of some of the GPIO pins. But when I read the information stored in __ghsbegin_initdata (or whatever it’s called in different codeparts) it is overwritten and does not seem to contain information from startup. If I look at the boot sequence I find that ncc_init() that stores the information seem to be called 3 times. 1) by rom bootloader (storing correct information). 2) by ram bootloader (overwriting the information). 3) by application (overwriting the information). So when I try to use the information in my application it does not seem to be valid: I always have same information in SSR no matter if software, watchdog or power up reset. The information about GPIO state is also overwritten by GPIO initialization. Have I misunderstood something or have I stumbled over a bug in the boot system? Best regards, Thomas Maltesen