tekhex buffer management and symbol types
authorAlan Modra <amodra@gmail.com>
Fri, 7 Nov 2014 09:59:43 +0000 (20:29 +1030)
committerAlan Modra <amodra@gmail.com>
Fri, 7 Nov 2014 10:10:42 +0000 (20:40 +1030)
commite5242d4bede9761e9847ca85f8477b4e275a6e22
tree904ea7b75989414c64e0b260fc9c1850a97443ac
parent7c53fd1ca357a5f6d0dcb3fcc6d06a38de48cd09
tekhex buffer management and symbol types

Dramatically reduces memory consumption and processing time for large
all-zero data segments.  Allows multiple symbol types attached to a
given segment to survive objcopy.

* tekhex.c (CHUNK_SPAN): Define.
(struct data_struct <chunk_init>): Use one byte per span, update
all code accessing this field.
(find_chunk): Add create param, don't create new entry unless set.
(insert_byte): Don't save zeros.
(first_phase): Set section SEC_CODE or SEC_DATA flag depending
on symbol type.  Create an alternate section if both types of
symbol are given.  Attach type '2' and '6' symbols to absolute
section.
(move_section_contents): Fix caching of chunk.  Don't create chunk
when reading, or for writing zeros.
(tekhex_set_section_contents): Don't create initial chunks.
(tekhex_write_object_contents): Use CHUNK_SPAN.
bfd/ChangeLog
bfd/tekhex.c