Fix --gc-sections crash.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 30 Sep 2016 06:37:29 +0000 (06:37 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 30 Sep 2016 06:37:29 +0000 (06:37 +0000)
commitc1eff79f61ff76e181fa73e0478d14a9d3d58008
treed9a8876bca729f0c969f305e4c2c43e3553ab5fc
parentacac3ab7797c69fcb3a55277dc59bf286351ab96
Fix --gc-sections crash.

We would crash when a non-alloca section pointed to a gced part of a
merge section.

That can happen when a C/c++ constant in put in a merge section and
debug info is present.

llvm-svn: 282845
lld/ELF/InputSection.cpp
lld/test/ELF/gc-sections-non-alloc-to-merge.s [new file with mode: 0644]