diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2014-11-22 23:19:31 +0000 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2014-12-23 15:45:11 +0000 |
commit | eac7440d805bec68f583db395aa42c38615daf14 (patch) | |
tree | e93db6bdf6f377b7edb83726e1228a73d1ea960e /gas/testsuite | |
parent | c01feb367543270196672dedf9a8365a2d8d3cff (diff) | |
download | gdb-eac7440d805bec68f583db395aa42c38615daf14.zip gdb-eac7440d805bec68f583db395aa42c38615daf14.tar.gz gdb-eac7440d805bec68f583db395aa42c38615daf14.tar.bz2 |
AVR: Only set link-relax elf flag when appropriate.
The AVR target uses a bit in the elf header flags to indicate if the
object was assembled ready for linker relaxation. Previously this flag
was always set, even when the object was not assembled ready for linker
relaxation.
This patch moves setting of the flag into the assembler, and sets it
only when the assembler is preparing the file for linker relaxation.
bfd/ChangeLog:
* elf32-avr.c (bfd_elf_avr_final_write_processing): Don't set
EF_AVR_LINKRELAX_PREPARED unconditionally.
gas/ChangeLog:
* config/tc-avr.c: Add include for elf/avr.h.
(avr_elf_final_processing): New function.
* config/tc-avr.h (elf_tc_final_processing): Define.
(avr_elf_final_processing): Declare
gas/testsuite/ChangeLog:
* gas/avr/link-relax-elf-flag-clear.d: New file.
* gas/avr/link-relax-elf-flag-set.d: New file.
* gas/avr/link-relax-elf-flag.s: New file.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gas/testsuite/gas/avr/link-relax-elf-flag-clear.d | 10 | ||||
-rw-r--r-- | gas/testsuite/gas/avr/link-relax-elf-flag-set.d | 10 | ||||
-rw-r--r-- | gas/testsuite/gas/avr/link-relax-elf-flag.s | 4 |
4 files changed, 30 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 7c76bbc..d6d6450 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-12-23 Andrew Burgess <andrew.burgess@embecosm.com> + + * gas/avr/link-relax-elf-flag-clear.d: New file. + * gas/avr/link-relax-elf-flag-set.d: New file. + * gas/avr/link-relax-elf-flag.s: New file. + 2014-12-19 Matthew Fortune <matthew.fortune@imgtec.com> * gas/mips/r6-64.s: Remove .align directives from LDPC diff --git a/gas/testsuite/gas/avr/link-relax-elf-flag-clear.d b/gas/testsuite/gas/avr/link-relax-elf-flag-clear.d new file mode 100644 index 0000000..88cd3c9 --- /dev/null +++ b/gas/testsuite/gas/avr/link-relax-elf-flag-clear.d @@ -0,0 +1,10 @@ +#name: AVR, check elf link-relax header flag is clear. +#as: -mmcu=avrxmega2 +#readelf: -h +#source: link-relax-elf-flag.s +#target: avr-*-* + +ELF Header: +#... + Flags: 0x66, avr:102 +#...
\ No newline at end of file diff --git a/gas/testsuite/gas/avr/link-relax-elf-flag-set.d b/gas/testsuite/gas/avr/link-relax-elf-flag-set.d new file mode 100644 index 0000000..5614d3f --- /dev/null +++ b/gas/testsuite/gas/avr/link-relax-elf-flag-set.d @@ -0,0 +1,10 @@ +#name: AVR, check elf link-relax header flag is set. +#as: -mlink-relax -mmcu=avrxmega2 +#readelf: -h +#source: link-relax-elf-flag.s +#target: avr-*-* + +ELF Header: +#... + Flags: 0xe6, avr:102, link-relax +#...
\ No newline at end of file diff --git a/gas/testsuite/gas/avr/link-relax-elf-flag.s b/gas/testsuite/gas/avr/link-relax-elf-flag.s new file mode 100644 index 0000000..af543e1 --- /dev/null +++ b/gas/testsuite/gas/avr/link-relax-elf-flag.s @@ -0,0 +1,4 @@ + .text + .global _start +_start: + nop |