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/config | |
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/config')
-rw-r--r-- | gas/config/tc-avr.c | 9 | ||||
-rw-r--r-- | gas/config/tc-avr.h | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c index dfe66c6..bda0bd6 100644 --- a/gas/config/tc-avr.c +++ b/gas/config/tc-avr.c @@ -25,7 +25,7 @@ #include "subsegs.h" #include "dwarf2dbg.h" #include "dw2gencfi.h" - +#include "elf/avr.h" struct avr_opcodes_s { @@ -1848,3 +1848,10 @@ avr_allow_local_subtract (expressionS * left, them. */ return FALSE; } + +void +avr_elf_final_processing (void) +{ + if (linkrelax) + elf_elfheader (stdoutput)->e_flags |= EF_AVR_LINKRELAX_PREPARED; +} diff --git a/gas/config/tc-avr.h b/gas/config/tc-avr.h index fb596ad..81ba0fc 100644 --- a/gas/config/tc-avr.h +++ b/gas/config/tc-avr.h @@ -213,3 +213,6 @@ extern void tc_cfi_frame_initial_instructions (void); relaxation, so do not resolve such expressions in the assembler. */ #define md_allow_local_subtract(l,r,s) avr_allow_local_subtract (l, r, s) extern bfd_boolean avr_allow_local_subtract (expressionS *, expressionS *, segT); + +#define elf_tc_final_processing avr_elf_final_processing +extern void avr_elf_final_processing (void); |