The function-sections and gc-sections allow for a more compact binary file. Unfortunately, the gc-sections switch causes the linker to erroneously remove the return function that xil_printf uses.
The only way to work around this issue is to not use the -ffunction-sections and --gc-sections switches. For more explanation on these switches, please refer to
(Xilinx Answer 21533).