diff options
author | Rui Ueyama <ruiu@google.com> | 2015-07-24 23:51:14 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2015-07-24 23:51:14 +0000 |
commit | cd3f99b6c534ad0d0e2040c6beea8e82b575123b (patch) | |
tree | c8d8811b7aa8a48c7bfd86203dc3e7634967470e /lld/COFF/SymbolTable.cpp | |
parent | 39497e9f5bd9c82c15b4d1798976e5daad5c7767 (diff) | |
download | bcm5719-llvm-cd3f99b6c534ad0d0e2040c6beea8e82b575123b.tar.gz bcm5719-llvm-cd3f99b6c534ad0d0e2040c6beea8e82b575123b.zip |
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
Diffstat (limited to 'lld/COFF/SymbolTable.cpp')
-rw-r--r-- | lld/COFF/SymbolTable.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lld/COFF/SymbolTable.cpp b/lld/COFF/SymbolTable.cpp index 14fb72480d9..d3f8b038460 100644 --- a/lld/COFF/SymbolTable.cpp +++ b/lld/COFF/SymbolTable.cpp @@ -317,8 +317,16 @@ Undefined *SymbolTable::addUndefined(StringRef Name) { return New; } -void SymbolTable::addRelative(StringRef Name, uint64_t VA) { - addSymbol(new (Alloc) DefinedRelative(Name, VA)); +DefinedRelative *SymbolTable::addRelative(StringRef Name, uint64_t VA) { + auto *New = new (Alloc) DefinedRelative(Name, VA); + addSymbol(New); + return New; +} + +DefinedAbsolute *SymbolTable::addAbsolute(StringRef Name, uint64_t VA) { + auto *New = new (Alloc) DefinedAbsolute(Name, VA); + addSymbol(New); + return New; } void SymbolTable::printMap(llvm::raw_ostream &OS) { |