COFF: Implement Safe SEH support for x86.
authorRui Ueyama <ruiu@google.com>
Fri, 24 Jul 2015 23:51:14 +0000 (23:51 +0000)
committerRui Ueyama <ruiu@google.com>
Fri, 24 Jul 2015 23:51:14 +0000 (23:51 +0000)
commitcd3f99b6c534ad0d0e2040c6beea8e82b575123b
treec8d8811b7aa8a48c7bfd86203dc3e7634967470e
parent39497e9f5bd9c82c15b4d1798976e5daad5c7767
COFF: Implement Safe SEH support for x86.

An object file compatible with Safe SEH contains a .sxdata section.
The section contains a list of symbol table indices, each of which
is an exception handler function. A safe SEH-enabled executable
contains a list of exception handler RVAs. So, what the linker has
to do to support Safe SEH is basically to read the .sxdata section,
interpret the contents as a list of symbol indices, unique-fy and
sort their RVAs, and then emit that list to .rdata. This patch
implements that feature.

llvm-svn: 243182
14 files changed:
lld/COFF/Chunks.cpp
lld/COFF/Chunks.h
lld/COFF/Config.h
lld/COFF/Driver.cpp
lld/COFF/InputFiles.cpp
lld/COFF/InputFiles.h
lld/COFF/SymbolTable.cpp
lld/COFF/SymbolTable.h
lld/COFF/Symbols.h
lld/COFF/Writer.cpp
lld/COFF/Writer.h
lld/test/COFF/Inputs/seh.c [new file with mode: 0644]
lld/test/COFF/Inputs/seh.obj.yaml [new file with mode: 0644]
lld/test/COFF/seh.test [new file with mode: 0644]