[PATCH] [ELF] Add CodeModel attribute to the DefinedAtom class

Simon Atanasyan simon at atanasyan.com
Wed Nov 12 14:23:48 PST 2014


Hi shankarke, ruiu, kledzik,

MIPS ELF symbols might contain some additional MIPS-specific flags in the st_other field besides visibility ones. These flags indicate code properties like microMIPS / MIPS16 encoding, position independent code etc. We need to transfer the flags from input objects to the output linked file to write them into the symbol table, adjust symbols addresses etc.

I add new attribute `CodeModel` to the `DefinedAtom` class to hold target specific flag and to get over YAML/Native format conversion barrier. Other architectures/targets can extend CodeModel enumeration by their own flags.

MIPS specific part of this patch adds support for `STO_MIPS_MICROMIPS` flag. This flag marks microMIPS symbols. Such symbol should:
  - Has `STO_MIPS_MICROMIPS` in the corresponding .symtab record.
  - Has adjusted (odd) address in the corresponding `.symtab` and `.dynsym` records.

http://reviews.llvm.org/D6236

Files:
  include/lld/Core/DefinedAtom.h
  lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h
  lib/ReaderWriter/ELF/Mips/MipsELFFile.h
  lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h
  lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h
  lib/ReaderWriter/ELF/OutputELFWriter.h
  lib/ReaderWriter/Native/NativeFileFormat.h
  lib/ReaderWriter/Native/ReaderNative.cpp
  lib/ReaderWriter/Native/WriterNative.cpp
  lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
  test/core/code-model-attributes.objtxt
  test/elf/Mips/st-other.test
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6236.16115.patch
Type: text/x-patch
Size: 16989 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141112/38a401fe/attachment.bin>


More information about the llvm-commits mailing list