Avoid a crash with -r and .comment.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 11 Nov 2016 21:36:25 +0000 (21:36 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 11 Nov 2016 21:36:25 +0000 (21:36 +0000)
commitd4372f783b52919c569f3e2007e3ba9edb45c7fb
treee2aedcf419ac2d03e54e26da2da5ee6a93999586
parent088faab429538c6123024f6f173ee6e35845f445
Avoid a crash with -r and .comment.

We would create a MergeInputSection for the synthetic .comment and
crash trying to add it to a regular output section.

With this we just don't add the synthetic section with -r. That is
consistent with gold that doesn't create .note.gnu.gold-version with
-r.

llvm-svn: 286635
lld/ELF/Writer.cpp
lld/test/ELF/relocatable-bss.s
lld/test/ELF/relocatable-comment.s [new file with mode: 0644]
lld/test/ELF/relocatable.s