Don't create dynamic relocations to ro segments.
authorRafael Espindola <rafael.espindola@gmail.com>
Sat, 30 Apr 2016 01:15:17 +0000 (01:15 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sat, 30 Apr 2016 01:15:17 +0000 (01:15 +0000)
commita85efd985c74716429b69cebbac1a5f438fd45d1
tree50a919ea3166bf28411c317dab86696f14c7a852
parent47cf2affbdb8a8152b84965134282581692baace
Don't create dynamic relocations to ro segments.

These would just crash at runtime.

If we ever decide to support rw text segments this should make it easier
to implement as there is now a single point where we notice the problem.

I have tested this with a freebsd buildworld. It found a non pic
assembly file being linked into a .so,. With that fixed, buildworld
finished.

llvm-svn: 268149
lld/ELF/InputSection.h
lld/ELF/Writer.cpp
lld/test/ELF/Inputs/protected-shared.s
lld/test/ELF/Inputs/undef-with-plt-addr.s
lld/test/ELF/copy-errors.s [new file with mode: 0644]
lld/test/ELF/copy-in-shared.s
lld/test/ELF/eh-frame-dyn-rel.s
lld/test/ELF/i386-got-and-copy.s
lld/test/ELF/undef-with-plt-addr.s
lld/test/ELF/x86-64-reloc-32-fpic.s
lld/test/ELF/x86-64-reloc-pc32-fpic.s