diff options
author | Denis Chertykov <chertykov@gmail.com> | 2015-07-08 21:35:19 +0300 |
---|---|---|
committer | Denis Chertykov <chertykov@gmail.com> | 2015-07-08 21:41:52 +0300 |
commit | 328e7bfdde7267f5e4b971bc6dca7b82aef77661 (patch) | |
tree | 55de9e4f72b35c5e1bbbec78e50812e47198ae8c /ld/testsuite/ld-avr | |
parent | 7c7f93f6e5ce31223acbe871fe0c7e4daf0d8bbc (diff) | |
download | gdb-328e7bfdde7267f5e4b971bc6dca7b82aef77661.zip gdb-328e7bfdde7267f5e4b971bc6dca7b82aef77661.tar.gz gdb-328e7bfdde7267f5e4b971bc6dca7b82aef77661.tar.bz2 |
Define DIFF_EXPR_OK for avr target to allow PC relative difference relocation.
When generating relocation (tc_gen_reloc) 32 bit relocation fixup
is changed to new 32 bit PC relative relocation if the fixup has pc-relative
flag set.
bfd/ChangeLog
2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* elf32-avr.c: Add 32 bit PC relative relocation for AVR target.
gas/ChangeLog
2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* config/tc-avr.c (tc_gen_reloc): Change 32 bit relocation to
32 bit PC relative and update offset if the fixup is pc-relative.
* config/tc-avr.h (DIFF_EXPR_OK): Define to enable PC relative diff
relocs.
gas/testsuite/ChangeLog
2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* gas/avr/pc-relative-reloc.d: New test for 32 bit pc relative reloc.
* gas/avr/per-function-debugline.s: New test source.
include/ChangeLog
2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* elf/avr.h: Add new 32 bit PC relative relocation.
ld/testsuite/ChangeLog
2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* ld-avr/gc-section-debugline.d: New test.
* ld-avr/per-function-debugline.s: Source for new test.
Diffstat (limited to 'ld/testsuite/ld-avr')
-rw-r--r-- | ld/testsuite/ld-avr/gc-section-debugline.d | 70 | ||||
-rw-r--r-- | ld/testsuite/ld-avr/per-function-debugline.s | 84 |
2 files changed, 154 insertions, 0 deletions
diff --git a/ld/testsuite/ld-avr/gc-section-debugline.d b/ld/testsuite/ld-avr/gc-section-debugline.d new file mode 100644 index 0000000..e98ff6c --- /dev/null +++ b/ld/testsuite/ld-avr/gc-section-debugline.d @@ -0,0 +1,70 @@ +#name: dwarf decoded line after gc-sections +#as: -mmcu=avr51 -gdwarf-sections -g +#ld: -mavr51 -gc-sections -u main +#objdump: --dwarf=decodedline +#source: per-function-debugline.s +#target: avr-*-* + +.*: file format elf32-avr + +Decoded dump of debug contents of section .debug_line: + +CU: .*: +File name Line number Starting address +per-function-debugline.s 39 0 + +per-function-debugline.s 40 0x2 + +per-function-debugline.s 41 0x4 + +per-function-debugline.s 42 0x6 + +per-function-debugline.s 47 0x8 + +per-function-debugline.s 48 0xc + +per-function-debugline.s 49 0x10 + +per-function-debugline.s 50 0x12 + +per-function-debugline.s 51 0x16 + +per-function-debugline.s 52 0x1a + +per-function-debugline.s 54 0x1c + +per-function-debugline.s 55 0x1e + +per-function-debugline.s 56 0x20 + +per-function-debugline.s 62 0x22 + +per-function-debugline.s 63 0x24 + +per-function-debugline.s 64 0x26 + +per-function-debugline.s 65 0x28 + +per-function-debugline.s 70 0x2a + +per-function-debugline.s 71 0x2e + +per-function-debugline.s 72 0x32 + +per-function-debugline.s 73 0x36 + +per-function-debugline.s 74 0x38 + +per-function-debugline.s 75 0x3c + +per-function-debugline.s 76 0x40 + +per-function-debugline.s 77 0x44 + +per-function-debugline.s 79 0x48 + +per-function-debugline.s 80 0x4a + +per-function-debugline.s 81 0x4c + + diff --git a/ld/testsuite/ld-avr/per-function-debugline.s b/ld/testsuite/ld-avr/per-function-debugline.s new file mode 100644 index 0000000..361cb00 --- /dev/null +++ b/ld/testsuite/ld-avr/per-function-debugline.s @@ -0,0 +1,84 @@ + .file "per-function-debugline.s" +__SP_H__ = 0x3e +__SP_L__ = 0x3d +__SREG__ = 0x3f +__RAMPZ__ = 0x3b +__tmp_reg__ = 0 +__zero_reg__ = 1 + .comm g,2,1 + .section .text.bar,"ax",@progbits +.global bar + .type bar, @function +bar: + push r28 + push r29 + rcall . + in r28,__SP_L__ + in r29,__SP_H__ +/* prologue: function */ +/* frame size = 2 */ +/* stack size = 4 */ +.L__stack_usage = 4 + ldd r24,Y+1 + ldd r25,Y+2 + adiw r24,1 + std Y+2,r25 + std Y+1,r24 + nop +/* epilogue start */ + pop __tmp_reg__ + pop __tmp_reg__ + pop r29 + pop r28 + ret + .size bar, .-bar + .section .text.foo,"ax",@progbits +.global foo + .type foo, @function +foo: + push r28 + push r29 + in r28,__SP_L__ + in r29,__SP_H__ +/* prologue: function */ +/* frame size = 0 */ +/* stack size = 2 */ +.L__stack_usage = 2 + lds r24,g + lds r25,g+1 + adiw r24,1 + sts g+1,r25 + sts g,r24 + nop +/* epilogue start */ + pop r29 + pop r28 + ret + .size foo, .-foo + .section .text.main,"ax",@progbits +.global main + .type main, @function +main: + push r28 + push r29 + in r28,__SP_L__ + in r29,__SP_H__ +/* prologue: function */ +/* frame size = 0 */ +/* stack size = 2 */ +.L__stack_usage = 2 + call foo + lds r24,g + lds r25,g+1 + sbiw r24,1 + sts g+1,r25 + sts g,r24 + lds r24,g + lds r25,g+1 +/* epilogue start */ + pop r29 + pop r28 + ret + .size main, .-main + .ident "GCC: (GNU) 6.0.0 20150630 (experimental)" +.global __do_clear_bss |