[PATCH] D39548: [ELF] Set the section size on the section start symbols

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 2 06:36:35 PDT 2017


arichardson created this revision.
Herald added a subscriber: emaste.

Currently lld sets a size of zero on all the __start_foo and foo_start
symbols. This is fine for most architectures except for CHERI. On CHERI
pointers are capabilities that not only contain an address but also bounds
and access permissions. An expression like `_DYNAMIC[0].d_tag` will fail at
runtime if we don't set the ELF symbol size. When taking the address of a
global we set the length of that capability from the ELF symbol size and
if it is zero the CPU will trap when we load 8 bytes from a capability with
length zero.


https://reviews.llvm.org/D39548

Files:
  ELF/Writer.cpp
  test/ELF/section-start-symbols.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39548.121298.patch
Type: text/x-patch
Size: 10731 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171102/16072d54/attachment.bin>


More information about the llvm-commits mailing list