Fail when string merge can't alloc memory
authorAlan Modra <amodra@gmail.com>
Fri, 29 Sep 2017 03:37:56 +0000 (13:07 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 29 Sep 2017 05:12:36 +0000 (14:42 +0930)
commitf6ac8c52c955b487dcb56d05fc93fced7b203294
treee6d5d5476dfced009be38e0f2ee3aa80d4d4b80a
parent1b8f6c7f827726b5f91745149f7d4329f10de7fd
Fail when string merge can't alloc memory

I was looking at Debian bug #874674 again today, and think I might
have spotted the problem.  It appears that merge.c tries to cope with
memory allocation failures in some circumstances, but doesn't quite
manage to get everything right.  This patch will make ld report memory
allocation failures instead of silently not merging strings.

* merge.c (merge_strings): Return FALSE on malloc failure.
(_bfd_merge_sections): Return failures from record_section and
merge_strings.
bfd/ChangeLog
bfd/merge.c