Do not handle zero-sized mergeable section as mergeable.
authorRui Ueyama <ruiu@google.com>
Wed, 3 Aug 2016 05:28:02 +0000 (05:28 +0000)
committerRui Ueyama <ruiu@google.com>
Wed, 3 Aug 2016 05:28:02 +0000 (05:28 +0000)
commit3ebc71eb9113885f4e3c29d024a504d5e470f37c
tree674f8dab1793817c231a47c4804042a4e72d702a
parent2bb23bfc73b1c56cb3e8638f908eb168665b8e15
Do not handle zero-sized mergeable section as mergeable.

Mergeable sections with size zero are useless because they don't
actually contain data, and therefore there's no merit ot merge them.
However, in reality, there are object files in the wild containing
such sections. Currently, LLD can't handle them proerply.

This patch makes LLD to handle such sections as if they are non-
mergeable to fix the issue.

Fixes bug 28822.

llvm-svn: 277568
lld/ELF/InputFiles.cpp
lld/test/ELF/merge-string-empty.s [new file with mode: 0644]
lld/test/ELF/relocation-past-merge-end.s
lld/test/ELF/writable-merge.s