Custom bootloader passing control to application code in STM32
The compiled image of an STM32 application begins with a vector table, in which the first word contains the initial stack pointer value, the next one has the address of the first instruction.

The bootloader must obviously know the address the application is loaded at (how could it load it otherwise?), so it can look at the first two words of the image it had just flashed.

You must take the layout of the flash sectors into account when deciding the start address of the application. If parts of the bootloader and the application end up in the same flash sector, then the bootloader won't be able to reflash the app.



The designers of this MCU had arranged a few shorter sectors at the beginning of the flash exactly for this purpose. You might want to reserve 32k for the bootloader, and place the application at 0x08008000 for example, it's up to you (and the complexity of the bootloader).


  Will it make a difference in the way it is actually implemented if I use Keil or GCC compiler?


The only difference would be in the linker configuration files, which tell the linker where to load the application. The GNU linker takes it from a linker script (*.ld), Keil calls it scatter file. They have the same purpose, but different syntax. You should adjust the linker script/scatter file of the bootloader too, limiting the amount of flash available to it.