Possible bug in stdio.h *_P functions
Tavish Naruka <[email protected]> Tue, 16 Aug 2016 14:56:58 +0530
| Newsgroups | gmane.comp.hardware.avr.gcc |
|---|---|
| Message-ID | <CAEz8Frg1ub2NQ1L2_fGYd_REcu4kTaPvfvOoGh1TiZmFJbw_Dg@mail.gmail.com> |
Hi I'm linking a program as a bootloader with --section-start, everything is working fine, except that stdio functions with _P do not work as expected, once I link the same program with --section-start=0x00, it works just fine. I am not sure but it seems to me that only 16-bit addresses are working since only registers r24 and r25 are being used for the function calls. Here is the difference in the generated assembly: Function call is puts_P(NOT_PRESSED_STR). Linked at 0x00-: 000000e4 <NOT_PRESSED_STR>: e4: 4e 6f 74 20 50 72 65 73 73 65 64 0a 00 Not Pressed.. 1d6: 00 00 nop 1d8: 84 ee ldi r24, 0xE4 ; 228 1da: 90 e0 ldi r25, 0x00 ; 0 1dc: 0e 94 f2 00 call 0x1e4 ; 0x1e4 <puts_P> Linked at 0x1E000-: 0001e0e4 <NOT_PRESSED_STR>: 1e0e4: 4e 6f 74 20 50 72 65 73 73 65 64 0a 00 Not Pressed.. 1e1d6: 00 00 nop 1e1d8: 84 ee ldi r24, 0xE4 ; 228 1e1da: 90 ee ldi r25, 0xE0 ; 224 1e1dc: 0e 94 f2 f0 call 0x1e1e4 ; 0x1e1e4 <puts_P> I haven't been able to find a workaround yet, so I'll use strings in initialized data section for now. -- Regards Tavish Naruka _______________________________________________ AVR-GCC-list mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/avr-gcc-list