[Cmake-commits] [cmake-commits] king committed cmComputeLinkInformation.cxx 1.45 1.46
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed Jun 10 14:11:42 EDT 2009
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv26009/Source
Modified Files:
cmComputeLinkInformation.cxx
Log Message:
BUG: Do not mangle symbols when editing RPATHs
In ELF binaries the .dynstr string table is used both for the RPATH
string and for program symbols. If a symbol name happens to match the
end of the build-tree RPATH string the linker is allowed to merge the
symbols.
We must not allow this when the RPATH string will be replaced during
installation because it will mangle the symbol. Therefore we always pad
the end of the build-tree RPATH with ':' if it will be replaced. Tools
tend not to use ':' at the end of symbol names, so it is unlikely to
conflict. See issue #9130.
Index: cmComputeLinkInformation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkInformation.cxx,v
retrieving revision 1.45
retrieving revision 1.46
diff -C 2 -d -r1.45 -r1.46
*** cmComputeLinkInformation.cxx 3 Jun 2009 19:08:30 -0000 1.45
--- cmComputeLinkInformation.cxx 10 Jun 2009 18:11:40 -0000 1.46
***************
*** 1706,1713 ****
}
! // If the rpath will be replaced at install time make sure it is
! // long enough now.
if(!for_install && this->RuntimeUseChrpath)
{
std::string::size_type minLength = this->GetChrpathString().length();
while(rpath.length() < minLength)
--- 1706,1718 ----
}
! // If the rpath will be replaced at install time, prepare space.
if(!for_install && this->RuntimeUseChrpath)
{
+ // Always add one trailing separator so the linker does not re-use
+ // the rpath .dynstr entry for a symbol name that happens to match
+ // the end of the rpath string.
+ rpath += this->GetRuntimeSep();
+
+ // Make sure it is long enough to hold the replacement value.
std::string::size_type minLength = this->GetChrpathString().length();
while(rpath.length() < minLength)
More information about the Cmake-commits
mailing list