[PATCH] [lld] Make ELFLinkingContext own LinkerScript buffers

Rafael Auler rafaelauler at gmail.com
Sun Feb 1 14:08:18 PST 2015


Hi ruiu, shankarke,

Currently, no one owns script::Parser buffers, but yet ELFLinkingContext gets
updated with StringRef pointers to data inside Parser buffers. Since this buffer
is locally owned inside GnuLdDriver::evalLinkerScript(), as soon as this
function finishes, all pointers in ELFLinkingContext that comes from linker
scripts get invalid. The problem is that we need someone to own linker scripts
data structures and, since ELFLinkingContext transports references to linker
scripts data, we can simply make it also own all linker scripts data.

http://reviews.llvm.org/D7323

Files:
  include/lld/ReaderWriter/ELFLinkingContext.h
  include/lld/ReaderWriter/LinkerScript.h
  lib/Driver/GnuLdDriver.cpp
  lib/ReaderWriter/ELF/ELFLinkingContext.cpp
  lib/ReaderWriter/LinkerScript.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7323.19115.patch
Type: text/x-patch
Size: 4850 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150201/3b9f1ba8/attachment.bin>


More information about the llvm-commits mailing list