avr/gas: Write out data to track .org/.align usage.
authorAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 8 Jan 2015 20:55:10 +0000 (20:55 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 25 Feb 2015 23:15:02 +0000 (23:15 +0000)
commitfdd410ac7a07dfb47dcb992201000582a280d8b2
tree1a68c9b9d5cf73d3e9f227ee5a46183652dcd498
parentac99436572d903781c124fa3cc72d83360202b76
avr/gas: Write out data to track .org/.align usage.

Adds support to the assembler to write out data for tracking the use of
.org and .align directives.  This data is collected within the assembler
and written out to a section ".avr.prop" (if there's anything to write
out).

This patch does not add any tests.  The next patch in this series will
add a better mechanism for visualising the contents of .avr.prop which
will make writing tests much easier.

This patch also does not make any use of this collected data, that will
also come along in a later patch; the intended consumer is the linker,
during linker relaxation this information will be used to ensure that
the .org and .align directives are honoured.

bfd/ChangeLog:

* elf32-avr.h (AVR_PROPERTY_RECORD_SECTION_NAME): Define.
(AVR_PROPERTY_RECORDS_VERSION): Define.
(AVR_PROPERTY_SECTION_HEADER_SIZE): Define.
(struct avr_property_record): New structure.

gas/ChangeLog:

* config/tc-avr.c: Add elf32-avr.h include.
(struct avr_property_record_link): New structure.
(avr_output_property_section_header): New function.
(avr_record_size): New function.
(avr_output_property_record): New function.
(avr_create_property_section): New function.
(avr_handle_align): New function.
(exclude_section_from_property_tables): New function.
(create_record_for_frag): New function.
(append_records_for_section): New function.
(avr_create_and_fill_property_section): New function.
(avr_post_relax_hook): New function.
* config/tc-avr.h (md_post_relax_hook): Define.
(avr_post_relax_hook): Declare.
(HANDLE_ALIGN): Define.
(avr_handle_align): Declare.
(strut avr_frag_data): New structure.
(TC_FRAG_TYPE): Define.
bfd/ChangeLog
bfd/elf32-avr.h
gas/ChangeLog
gas/config/tc-avr.c
gas/config/tc-avr.h