commit | 1683917d99e0e7c1b922e961b5cd0f20fd55d00f | [log] [tgz] |
---|---|---|
author | Matt Davis <nullptr@fb.com> | Thu Sep 26 17:03:20 2019 +0000 |
committer | Matt Davis <nullptr@fb.com> | Thu Sep 26 17:03:20 2019 +0000 |
tree | 4a9f0764dbdecc77657032b62db542c3602222bf | |
parent | 51997f03061bda3c31727fe3feaaf79720580f42 [diff] |
[lld][mach-o] Avoid segfaulting when handling an empty section list. Summary: The following patch avoids segfaulting if the section list is empty when writing a mach-o MH_OBJECT. I ran into this case from a more complicated example trying to dead_strip while using '-r' in lld. I'm not sure if having empty sections is a legal mach-o, but it does seem that other llvm-binutils tools can ingest such a boring object with out issue. Would it be better to emit an error, emit a warning, or do nothing? It seems that adding a warning diagnostic might be helpful to users, as I did not expect to have a section-less object when the linker was done. Reviewers: kledzik, ruiu Subscribers: llvm-commits, jrm Tags: #lld, #llvm Differential Revision: https://reviews.llvm.org/D67735 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@372995 91177308-0d34-0410-b5e6-96231b3b80d8
This directory and its subdirectories contain source code for the LLVM Linker, a modular cross platform linker which is built as part of the LLVM compiler infrastructure project.
lld is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt.
In order to make sure various developers can evaluate patches over the same tests, we create a collection of self contained programs.
It is hosted at https://s3-us-west-2.amazonaws.com/linker-tests/lld-speed-test.tar.xz
The current sha256 is 10eec685463d5a8bbf08d77f4ca96282161d396c65bd97dc99dbde644a31610f.