summaryrefslogtreecommitdiffstats
path: root/Source/cmELF.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-2/+1
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* Retire std::auto_ptr and its macro CM_AUTO_PTRMatthias Maennich2017-09-251-7/+6
| | | | Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Use C++11 override instead of CM_OVERRIDEBrad King2017-09-151-7/+7
| | | | | | | | We now require C++11 support including `override`. Drop use of the old compatibility macro. Convert references as follows: git grep -l CM_OVERRIDE -- '*.h' '*.hxx' '*.cxx' | xargs sed -i 's/CM_OVERRIDE/override/g'
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-8/+4
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-10/+10
|
* Pass large types by const&, small types by valueDaniel Pfeifer2017-06-031-4/+4
|
* cmELF: Remove now-redundant check for DT_RUNPATH's existenceMaya Rashish2017-04-261-4/+0
| | | | We define it if it's not already defined.
* cmELF: Define DT_RUNPATH if it isn't already definedMaya Rashish2017-04-261-0/+3
| | | | | | | The value of 29 is used by binutils and is used in the System V ABI draft from 2001. It isn't defined on NetBSD 6.0.
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-3/+3
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* elf: Remove GetDynamicEntryCount and ReadBytes methodsJames Cowgill2016-10-071-40/+1
| | | | These are no longer used after the DynamicEntryList changes.
* cmSystemTools, elf: handle DT_MIPS_RLD_REL_MAP in RemoveRPathJames Cowgill2016-10-071-0/+6
|
* elf: add DynamicEntryList methods and rpath tag constantsJames Cowgill2016-10-061-0/+77
|
* elf: remove tag switch from ELF_Dyn ByteSwap functionJames Cowgill2016-10-061-115/+5
| | | | | sizeof(dyn.d_un.d_val) always equals sizeof(dyn.d_un.d_ptr) so every byte swap call in this function is identical.
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-2/+6
|
* CMake: don't use else after returnDaniel Pfeifer2016-08-181-18/+9
|
* Make sure unnused parameters are /*named*/Daniel Pfeifer2016-08-161-4/+4
|
* cmELF: Port to SCO OpenServer 5.0.7/3.2Patrick Welche2016-08-021-2/+11
| | | | | | | | Take changes used by pkgsrc [1]: * SCO OpenServer 5.0.7/3.2 does not support 64-bit ELF. [1] http://cdn.netbsd.org/pub/pkgsrc/current/pkgsrc/devel/cmake/patches/
* Avoid using KWSys auto_ptr by adopting it ourselvesBrad King2016-06-291-6/+7
| | | | | | | | | | | | Replace use of cmsys::auto_ptr with a CM_AUTO_PTR macro that maps to our own implementation adopted from the KWSys auto_ptr implementation. Later we may be able to map CM_AUTO_PTR to std::auto_ptr on compilers that do not warn about it. Automate the client site conversions: git grep -l auto_ptr -- Source/ | grep -v Source/kwsys/ | xargs sed -i \ 's|cmsys::auto_ptr|CM_AUTO_PTR|;s|cmsys/auto_ptr.hxx|cm_auto_ptr.hxx|'
* use CM_NULLPTRDaniel Pfeifer2016-06-281-10/+10
|
* Add CM_OVERRIDE to some functionsDaniel Pfeifer2016-06-271-5/+5
| | | | | | | Run clang-tidy's modernize-use-override checker. This checker must have issues in version 3.8. It has way too little matches. And it adds override to destructors. Revert the changes on the destructors and change override to CM_OVERRIDE.
* Simplify boolean expressionsDaniel Pfeifer2016-06-021-3/+3
| | | | | | Use clang-tidy's readability-simplify-boolean-expr checker. After applying the fix-its, revise all changes *very* carefully. Be aware of false positives and invalid changes.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-357/+342
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-22/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Source: Stabilize include orderBrad King2016-04-291-0/+1
| | | | | Each source file has a logical first include file. Include it in an isolated block so that tools that sort includes do not move them.
* Port CMake from cmIML to KWIMLBrad King2015-12-181-7/+4
| | | | KWIML no longer uses a configured prefix.
* cmELF: Use KWIML ABI.h header to get endian-nessBrad King2015-12-091-4/+3
| | | | Port away from KWSys CPU header.
* cmELF: Avoid divide by zero if there are no dynamic section entriesTy Smith2015-11-191-1/+7
|
* Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-1/+1
| | | | All compilers hosting CMake support the std class.
* cmELF: fix signedness warning on OpenBSDRolf Eike Beer2014-04-141-6/+9
| | | | | | | | | | | | | | | OpenBSD defines Elf64_Dyn::d_tag to be of an unsigned type, which differs from what most other platforms do and what is the case for 32 bit. To have the tag as unsigned makes sense, but this causes a compilation warning: /.../CMake/Source/cmELF.cxx: In member function 'const cmELF::StringEntry* cmELFInternalImpl<Types>::GetDynamicSectionString(int) [with Types = cmELFTypes64]': /.../CMake/Source/cmELF.cxx:945: instantiated from here /.../CMake/Source/cmELF.cxx:668: warning: comparison between signed and unsigned integer expressions Add an explicit typedef to cast the value to for 32 and 64 bit. That type is unsigned and has the proper length for both platforms so no information is lost. Explicitely cast both arguments before comparing them to avoid the warning in all situations.
* Haiku: Enable CMake builtin ELF editorAdrien Destugues2014-03-211-0/+20
| | | | Co-Author: Brad King <brad.king@kitware.com>
* cmELF: Fix typo in comment, 32-bit => 64-bit (#14799)Ryo ONODERA2014-03-101-1/+1
|
* Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.Clinton Stimpson2014-01-071-4/+5
| | | | | Also use SystemTools::Fopen() instead of fopen(). This is to eventually support utf-8 filenames.
* OpenBSD: Enable ELF parsing and editing (#14241)David Coppa2013-06-211-1/+6
| | | | | | | | | OpenBSD provides ELF ABI declarations in #include <stdint.h> #include <elf_abi.h> Teach the platform check and cmELF implementation to use these.
* Fix line-too-long style errorsBrad King2010-09-101-1/+2
|
* Fix or cast integer conversions in cmakeBrad King2010-06-251-1/+1
| | | | | These were revealed by GCC's -Wconversion option. Fix types where it is easy to do so. Cast in cases we know the integer will not be truncated.
* Try to remove some warnings.Bill Hoffman2010-05-121-1/+1
|
* Use explicit conversion to avoid warnings in cmELFBrad King2009-10-061-2/+2
|
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | This converts the CMake license to a pure 3-clause OSI-approved BSD License. We drop the previous license clause requiring modified versions to be plainly marked. We also update the CMake copyright to cover the full development time range.
* BUG: Fix operator precedence error in cmELFBrad King2008-08-041-4/+4
| | | | | | When attempting to load the RPATH out of a non-ELF file cmELF would crash because the check for a valid file was done with in correct operator precedence. See bug#7392.
* BUG: When byte order is not known at compile time make sure NeedSwap in ↵Brad King2008-05-131-0/+2
| | | | cmELF is still initialized.
* ENH: In cmELF it is okay if the byte order is not known at compile time.Brad King2008-05-131-0/+1
| | | | - We perform a runtime check of the input file anyway.
* COMP: Fix signed/unsigned comparison warning in cmELF.Brad King2008-04-151-1/+1
|
* ENH: Added cmELF methods to get information about DYNAMIC section entries.Brad King2008-04-141-0/+88
|
* COMP: Fix cmELF to build when ET_LOOS, ET_HIOS, ET_LOPROC, ET_HIPROC may not ↵Brad King2008-03-031-19/+39
| | | | be defined.
* BUG: Fix bug introduced by workaround to warning.Brad King2008-03-021-0/+1
|
* BUG: A few more corrections for cmELFBrad King2008-03-021-10/+71
| | | | | | - Add os-specific and processor-specific file types - Add more error strings for invalid files. - Byte order of header fields does not always match encoding
* ENH: Add Size member to cmELF::StringEntry to return the amount of space in ↵Brad King2008-03-011-7/+33
| | | | the string entry.
* ENH: Make cmELF parser more general and powerfulBrad King2008-02-291-28/+135
| | | | | | - Add support to get RPATH and RUNPATH entries. - Add support to get file offsets to strings. - Add more DT_* tags to byte swapping.