From e4dd2e01323ab59dfb5766112fa34516f8fe6265 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 29 Apr 2013 22:24:22 +0000 Subject: Add getSymbolAlignment to the ObjectFile interface. For regular object files this is only meaningful for common symbols. An object file format with direct support for atoms should be able to provide alignment information for all symbols. This replaces getCommonSymbolAlignment and fixes test-common-symbols-alignment.ll on darwin. This also includes a fix to MachOObjectFile::getSymbolFlags. It was marking undefined symbols as common (already tested by existing mcjit tests now that it is used). llvm-svn: 180736 --- llvm/lib/Object/ObjectFile.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/lib/Object/ObjectFile.cpp') diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp index 518959a..77fd995 100644 --- a/llvm/lib/Object/ObjectFile.cpp +++ b/llvm/lib/Object/ObjectFile.cpp @@ -27,6 +27,12 @@ ObjectFile::ObjectFile(unsigned int Type, MemoryBuffer *source) : Binary(Type, source) { } +error_code ObjectFile::getSymbolAlignment(DataRefImpl DRI, + uint32_t &Result) const { + Result = 0; + return object_error::success; +} + ObjectFile *ObjectFile::createObjectFile(MemoryBuffer *Object) { if (!Object || Object->getBufferSize() < 64) return 0; -- cgit v1.1