bfd: support section groups with preceding SHF_GROUP sections
authorJose E. Marchesi <jose.marchesi@oracle.com>
Tue, 6 Jun 2017 18:19:06 +0000 (11:19 -0700)
committerJose E. Marchesi <jose.marchesi@oracle.com>
Tue, 6 Jun 2017 18:19:06 +0000 (11:19 -0700)
commit78e8a2ff5f01799874be41fdc919d34c670496c6
treea5aec46996fa8748a4347dbd10eb3ba24270cdf5
parentf4a6504277d861057aedd2b88369493d644935c6
bfd: support section groups with preceding SHF_GROUP sections

GAS always places section groups (SHT_GROUP) before the rest of the
sections in the output file.  However, other assemblers may place
section groups after the group members.

This patch fixes handlign such situations, and removes some duplicated
logic.

bfd/ChangeLog:

2017-06-06  Jose E. Marchesi  <jose.marchesi@oracle.com>

* elf.c (setup_group): Make sure BFD sections are created for all
group sections in the input file when processing SHF_GROUP
sections.
(bfd_section_from_shdr): Avoid duplicating logic already
implemented in `setup_group'.
bfd/ChangeLog
bfd/elf.c