-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows, NDK r14: link time optimization does not work with Clang #313
Comments
I know it doesn't help you but https://github.com/android-ndk/ndk/wiki/Changelog-r14 says "LTO with Clang now builds without errors on Linux and Darwin.". I don't think LTO has been fixed for Windows but @DanAlbert knows for sure. |
That's not the the error I'd expect to see. We don't even have LLVMgold.dll in the NDK: #251 The forced optimization level is weird, but I'm guessing there's a reason for it. @stephenhines @pirama-arumuga-nainar, I don't suppose either of you know why Clang doesn't allow |
|
LLVMgold.so seems to define its own optimization level and it currently supports O0 through O3. The problem is that Clang's driver doesn't fully sanitize its optimization level before passing it to the Gold plugin. It sanitizes O4 and Ofast down to O3 but doesn't handle Os or Oz. https://github.com/llvm-mirror/clang/blob/master/lib/Driver/Tools.cpp#L1210. I'll create an issue upstream. The driver should pass a suitable optimization level to the plugin in case of Os or Oz. The plugin could make better space-oriented decisions while adding the optimization levels. It's just a question of plumbing through the optimization level back to PassManagerBuilder (https://github.com/llvm-mirror/llvm/blob/master/lib/Transforms/IPO/PassManagerBuilder.cpp#L860) I think it might be possible to pull in the patch sanitizing Os and Oz for r15. I'd also suggest looking at passing '-plugin-opt=disable-inlining' to the linker. @psiha Did you invoke the clang driver when you experimented with OSX, Linux and MSVC? i.e. did you invoke |
Created https://bugs.llvm.org/show_bug.cgi?id=32155 in the LLVM issue tracker. |
We do test on Windows and Darwin. Not sure why you think we don't. In fact, the reason we don't have LTO on Windows right now is because it is a different environment and adding support for it is going to require thorough testing before we ship it.
This is still a thing? @pirama-arumuga-nainar, could you fix the driver for this? I thought we'd fixed this ages ago.
Ah, that issue was because |
That compiler codegen option logic is duplicated (or even worse, different) between clang and the LTO plugin (which, from a logic perspective, should just invoke the compiler, sans the front end, on the single huge TU available at link time) smells like a horrible hack... '-plugin-opt=disable-inlining' is not an option as I do not want to disable inlining just disable the, often insane, inlining level done @o3 (i.e. use a much lower threshold since conservative inlining can also reduce the codegen size)... and, of course, Clang being totally crippled compared to GCC WRT codegen options and pragmas does not provide an option to control the inlining threshold - yes LLVM does but I can only imagine what will happen if I try to pass --mllvm options to the linker if even the documented things that are supposed to work fail every so often like this... (In this regard/for LTO) We use the same compiler options for Clang on OSX, iOS and Android and only Android exhibits this behaviour/bug...since you claim you test on OSX you can investigate this further yourselves (if I find the time I may go through the -v output)... |
Your answer offers some queues as to why I think so ;p : "This is still a thing? ... I thought we'd fixed this ages ago." "reason we don't have LTO on Windows right now is because it is a different environment and adding support for it is going to require thorough testing before we ship it." ...and need I mention 'that one time' when the official NDK release for Windows failed to even unzip?... Things that are tested either work or are listed under 'known issues'...
And it is so - as I said, the same CMake logic is used for the Android flags regardless of the host OS (and most Clang flags, LTO ones specifically are also the same across host and target OSs) and it works on OSX...True, trying yet-another-rebuild on Windows today I now get the could not load plugin library error... ps. and yet another discovered LTO failure on this platform #318 ... :/ |
Sorry, I think I've been unclear. Windows Clang+LTO is currently unsupported. That's why it's neither tested nor marked as a known issue. I don't list all open feature requests in our release notes, and neither does any other product I know of. This is something we're going to be looking in to, fwiw, it's just not ready yet. IMO the highest priority issue is getting libc++ into better shape, which is why that gets most of my focus these days. I'm worried that we won't have this done quickly enough to satisfy you, but the good news is that we're an open source project. I'd be happy to review (or find a reviewer for) any changes you'd like to contribute. The NDK's contribution guide is here, and our README.md is the landing page for our docs. Otherwise, please understand that there is a limit to the number of things I can get done each release. This absolutely is something I want to support in the future, but these things take time. |
I'm seeing this too. After following @psiha 's advice and changing C:/adt/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld.gold.exe: error: C:\adt\sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin/../lib64/LLVMgold.so: could not load plugin library: unable to load dll This is with NDK 14b, building for armeabi-v7a. Not supporting LTO with clang on Windows is rather confusing since you're also calling GCC deprecated/unsupported. Please let me know if there's a workaround available. |
Yeah, we don't build or ship this for Windows. I've uploaded a change to start building it (https://android-review.googlesource.com/c/435495/, will need a couple more changes to make sure it gets into the NDK), but there are more problems beyond that. Looks like even with the gold plugin in place, gold still can't load it properly on Windows. It looks like that's just a matter of other dependencies not being anywhere in the library load path on Windows (on Linux/Darwin we use an rpath to tell the linker where to find them, but that's not a thing in Windows). I'm building gold atm to see if my fix for this will work. I'm hoping we'll have this for r16 beta 1. Assuming it's just this gold thing and the logistics of actually shipping it, that's doable. If there's anything actually wrong with LTO on Windows (that would be surprising to me), it will likely take a bit longer. |
Test: ./build.py Bug: android/ndk#313 Change-Id: I8ba563a67a193ff1baf693bf765116edeff3194b
We can use GetLastError/FormatMessage to get a less useless error message from dlerror. Use LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR to search the loaded library's directory to satisfy dependencies. Test: toolchain/gcc/build.py --toolchain arm-linux-androideabi \ --host windows64 Bug: android/ndk#313 Change-Id: Ia54e75b2ccbb6a4860e1d3e6250468ea053a4ce5
Even with building and shipping this library, it doesn't to work on Windows. It has heap corruption issues that I haven't had time to drill into yet. Will be taking a closer look after we get a new clang, but this is off the table for beta 1. |
We can use GetLastError/FormatMessage to get a less useless error message from dlerror. Use LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR to search the loaded library's directory to satisfy dependencies. Test: toolchain/gcc/build.py --toolchain arm-linux-androideabi \ --host windows64 Bug: android/ndk#313 This change is forward-port of c/438069 - https://android-review.googlesource.com/#/c/438069 to binutils-2_27-branch. Change-Id: I66840280cdd7b4176a1ad02f022457bd0336d101
The good news is that getting Android's Clang moved over to the upstream build process fixes the issues on Windows. The bad news is that there are too many other regressions caused by that switch that are still being worked through, so there won't be a compiler update for r16. Should be available in r17 though. |
So we'll maybe get LTO halfway through 2018!? Luckily the current compiler isn't some random buggy commit so we can safely wait until then for a compiler update...oh wait no, the current Android Clang 'optimizes': if ( var ) to return 6; ...what a joke of a platform... |
We're an open source project. If you're not satisfied with the rate of progress, feel free to help out. You can find our contribution guide here: |
I have used LLVM's own linker (lld) for LTO both on Windows and Linux for about a year (since r13 came out). lld has support for LTO by default, so no LLVMgold.so plugin is needed. I highly recommend giving lld a try for those having issues with LTO on Windows. It is also significantly faster than the gold linker (claimed to be 2x faster, my tests on some fairly large projects seems to support that claim). |
Veigres, thank you for usefull information. I have build lld linker on windows by using following batch file
see also https://lld.llvm.org/#build document Then I copied lld linker to standaloneTolchain_x86\i686-linux-android\bin\ld.exe. The linker works fine for x86 and Armv7 cpu. Executable become much smaller! I found difference. Command line option "--fix-cortex-a8" is not recognized by lld linker. |
If you are building for 64-bit ARM, you should be aware that lld is missing at least one patch for fixing some cortex-a53 errata (https://reviews.llvm.org/D36742). This is one reason why we haven't productionized lld yet for Android's NDK. It is definitely something that we are working on though. |
Confirmed fixed in build 4487575 (from master, will be in r17). |
We need this change to find LLVMgold.dll's libwinpthread-1.dll dependency. The same modification was already applied to the Android gold linker: https://android-review.googlesource.com/c/toolchain/binutils/+/438069. Test: toolchain/gcc/build.py --toolchain aarch64-linux-android \ --host windows64 Test: ./build.py --arch=arm --host win64 Bug: android/ndk#313 Bug: android/ndk#632 Change-Id: I0af8716bdc90e2d88954e7790a67da0d47b88c96
Cherry-pick of the patch to get LTO working on Windows. Test: ./checkbuild.py && ./run_tests.py Test: Built a project with LTO on Windows Bug: android/ndk#313 Change-Id: I6cbbb4bf2b8853f9a652dd4e7b52e98c5820c9c6
This error still happens in NDK r18 and also in NDK r17 and r17b. |
seems like that's a gold-specific error. in r18, can you try lld? from the r18 release notes: "LLD is now available for testing. AOSP is in the process of switching to using LLD by default and the NDK will follow (timeline unknown). Test LLD in your app by passing -fuse-ld=lld when linking." |
This is actually a little annoying atm since the build systems will still force |
With LLD I get this error:
I am now using Of course, as @DanAlbert mentioned, I had to comment out the |
/me checks llvm source. oh, yeah. different linker, different error message, same bug :-) @chih-hung will know whether this is a known lld bug... @pirama-arumuga-nainar in case this is WAI for LTO? (it occurs to me i'm just assuming that LTO should work even for |
We have another bug open for this already. We should take this conversation over to #721 |
…n WSL (#1744) * Fix libffi linker errors when compiling on WSL Optional use of lld (LLVM's linker), and include a python37 bugfix. https://clang.llvm.org/docs/Toolchain.html https://lld.llvm.org/ https://bz-attachments.freebsd.org/attachment.cgi?id=200526 * Remove lld unsupported fix-cortex-a8 from LDFLAGS android/ndk#313 android/ndk#766 https://developer.android.com/ndk/guides/standalone_toolchain * Fix libffi recipe, runtime libffi linker errors. Libtool didnt like the space after --sysroot, replaced with = * CRAs - Check for lld before using it. Changed hardcoded cpu count to cpu_count(). Added comment to python patch. Made remove-fix-cortex-a8.patch conditional on lld. Moved LDFLAGS change to get_recipe_env() so its not libffi specific within python.py.
* Update toolchain/binutils from branch 'master' to fcb56510b39e391c76f4931a64d19569024fbf1d - Fix dwarf_reader.cc for C++11 This commit replaces `std::make_pair<int, std::string>(dirindex, path)` with `std::make_pair(dirindex, path)` because C++11 replaces `std::make_pair<T, V>(T t, V v)` with `std::make_pair<T, V>(T &&t, V &&v)`. This commit removes explicit template arguments because forward references are only available during template arguments deduction. If the explicit template arguments are specified, the argument `t` and `v` will become R-value references, which can not bind to an L-value. Test: It builds with clang++ (or g++) with CXXFLAGS="-std=c++11" Change-Id: I79eb94552445354f7e7bff02169879195c7f6283 - Add support for the Cortex-A55 and Cortex-A75 Based on upstream change 1e2926 and 15a769. Bug: 110235326 Change-Id: Ieee5ad4cfb0aa21b46e918191215c4ce12248661 - bfd: PR22829, objcopy/strip removes PT_GNU_RELRO from lld binaries lld lays out the relro segment differently to GNU ld, not bothering to include the first few bytes of .got.plt and padding out to a page at the end of the segment. This patch teaches binutils to recognize the different (and somewhat inferior) layout as valid. bfd/ PR 22829 * elf.c (assign_file_positions_for_non_load_sections): Rewrite PT_GNU_RELRO setup. ld/ * testsuite/ld-x86-64/pr14207.d: Adjust relro p_filesz. This change is backport of commit f2731e0c374e5323ce4cdae2bcc7b7fe22da1a6f - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=f2731e0c374e5323ce4cdae2bcc7b7fe22da1a6f to binutils-2.27. Change-Id: I9d598adb1a0ef4778f0f29d0faf19c7c8112a74a - Windows: enable gold threading, copy libwinpthread-1.dll Copy libwinpthread-1.dll alongside the binutils executables on Windows. The install_winpthreads function is copied from llvm_android: https://android.googlesource.com/toolchain/llvm_android/+/bd22d9779676661ae9571972dcd744c42c70ffd0/build.py#1063 Most C++ MinGW programs need libpthread, because even libstdc++'s "operator new" pulls in EH code, which calls into libpthread. Currently, the ld.gold.exe and dwp.exe binaries need libwinpthread-1.dll, which is not generally in the PATH, so the binaries don't run. Previously, the Android GCC build of binutils linked ld.gold.exe and dwp.exe with -static, which selected the static libpthread.a. Packaging libwinpthread-1.dll alongside the binaries ensures that ld.gold.exe and the LLVMgold plugin use the same copy of the winpthreads runtime, which might be important. Test: ./toolchain/binutils/build.py --arch arm64 --host win64 Test: ./toolchain/binutils/build.py --arch arm64 --host win Test: ./toolchain/binutils/build.py --arch arm64 --host linux Test: ./toolchain/binutils/build.py --arch x86 --host win64 Bug: none Change-Id: I5fc2d38b67c72fa4760be1c2688ef88479759160 - gold: fix build errors on darwin. Some cc files include both "gold.h" and "output.h", which makes the compiler on mac complain about redefinition of __STDC_FORMAT_MACROS. Change-Id: I11875d9b76d27449167485ae5f91f026acbda8e1 - gold: add support for relative relocations at odd offsets. If the relocation offset is odd, create the relocation in rela_dyn section instead of the relr_dyn section. Bug: None Test: Verified relocations after linking test binary with odd offset. Change-Id: If0d65176639bfb7401f7fb2dd43efc55c17670a4 - gold: better error message on seeing odd offset for RELR relocation. Print a more informative error message instead of asserting out. This prints errors for all the odd offsets before exiting gold. Bug: None Test: Verified error message on linking test binary with odd offset. Change-Id: Ib481a4983cac2e637b1128ea0559d9606e671c35 - Fix problem where undef can fail to trigger archive rescan. If a shared library contains an undefined symbol and LTO adds a new reference to that same undefined symbol, the reference in the new object added by the plugin would not trigger a rescan of the archive containing the symbol. 2017-11-17 Stephen Crane <sjc@immunant.com> gold/ PR gold/22448 * symtab.cc (Symbol_table::add_from_object): Only rescan for undefined symbols in regular, not dynamic, objects. This change is backport of commit 71739b698d47945463f183619078ff680c277f0f - https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=71739b698d47945463f183619078ff680c277f0f to binutils-2.27. Change-Id: I9d926d8c56b02601785e18c88ef886ed2433c25b - Build binutils with --disable-nls The --disable-nls flag is also used to build gdb and gcc for Android. Adding it here prevents 428 *.mo files from being added to the next NDK release. (AFAICT, the SDK and NDK currently have no *.mo files.) It also fixes a sporadic build failure that can happen when binutils needs its bundled copy of libintl/gettext (see build 4635300 of ab/aosp-binutils or the linked issue). Test: ./toolchain/binutils/build.py --arch arm --host win Test: ./toolchain/binutils/build.py --arch arm --host win64 Test: ./toolchain/binutils/build.py --arch arm --host linux Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=22941 Change-Id: I0810406dc52f366fac7491676c2d5cb000fcfcaa - Upgrade Linux host toolchain from glibc 2.11 to 2.15 Bug: b/73539603 Test: ./toolchain/binutils/build.py --host linux --arch arm Change-Id: I7cd2706464093e2be058917996b2eb2bb7ce9663 - Merge "Don't default to gold for aarch64." - Explicitly use -m64. The Darwin toolchain builds 32-bit binaries by default. Might as well be explicit for all platforms. Test: ./build.py --arch arm64 --host linux Bug: None Change-Id: I350ab805441aa99f45c7166b7a27840438d6bf75 - Don't default to gold for aarch64. Test: ./build.py --arch arm64 --host linux Bug: https://issuetracker.google.com/70838247 Change-Id: I70506b9b12d2d904e109536a01276feb7582adc5 - Merge "Windows LTO: bfd: Search plugin dir for dependencies" - Fix binutils package name. Test: ./build.py --arch arm64 --host linux Bug: None Exempt-From-Owner-Approval: trivially correct Change-Id: I3339bfa694be929ad44b87d75a4cf3621b58451c - Windows LTO: bfd: Search plugin dir for dependencies We need this change to find LLVMgold.dll's libwinpthread-1.dll dependency. The same modification was already applied to the Android gold linker: https://android-review.googlesource.com/c/toolchain/binutils/+/438069. Test: toolchain/gcc/build.py --toolchain aarch64-linux-android \ --host windows64 Test: ./build.py --arch=arm --host win64 Bug: https://github.com/android-ndk/ndk/issues/313 Bug: https://github.com/android-ndk/ndk/issues/632 Change-Id: I0af8716bdc90e2d88954e7790a67da0d47b88c96 - gold: simpler encoding for SHT_RELR sections. This change modifies the encoding used in SHT_RELR sections to a simpler version that gives better results. This encoding was suggested by Andrew Grieve and is described in this post on generic-abi@googlegroups.com: https://groups.google.com/d/msg/generic-abi/bX460iggiKg/Pi9aSwwABgAJ Bug: None Test: 'gold --experimental-use-relr' creates PIE binaries with '.relr.dyn' sections to store relative relocations using the new encoding. Change-Id: I0dd0a7e0767210d06f29a86b97c5caded05b91e9 - Use {i686,x86_64}-w64-mingw32 triples Test: ./toolchain/binutils/build.py --arch arm --host win Test: ./toolchain/binutils/build.py --arch arm --host win64 Change-Id: I0a47faa82c9690acf2ea3e50f8bcb812fdbc6fc9 - gold, readelf: add experimental support for SHT_RELR sections. This change adds experimental support for SHT_RELR sections, proposed here: https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg SHT_RELR sections are supported for arm, aarch64, and x86_64 targets. To enable them, pass '--experimental-use-relr' flag to gold. Definitions for the new ELF section type and dynamic array tags, as well as the encoding used in the new section are all under discussion and are subject to change. Use with caution! Bug: None Test: 'gold --experimental-use-relr' creates PIE binaries with '.relr.dyn' sections to store relative relocations. Change-Id: Iefb4ef5ad95852f4964adf6c8e9b3708a9bdb5f8 - Merge "ld.bfd: omit DF_1_PIE when targeting Android" - ld.bfd: omit DF_1_PIE when targeting Android Some versions of the Android dynamic linker (e.g. N) print a warning: WARNING: linker: /data/local/tmp/a.out: unsupported flags DT_FLAGS_1=0x8000000 ${target} will be something like: - arm-unknown-linux-androideabi - aarch64-unknown-linux-android - i686-pc-linux-android Bug: https://github.com/android-ndk/ndk/issues/602 Test: manual: 1. create a standalone ARM64 toolchain with NDK r16b 2. echo 'int main() {}' > justmain.c 3. ~/stand-arm64-21-libc++-r16b/bin/clang justmain.c -pie -fPIE \ -fuse-ld=bfd && \ readelf -d a.out | grep FLAG -- OUTPUT: 0x000000006ffffffb (FLAGS_1) Flags: 8000000 4. ~/stand-arm64-21-libc++-r16b/bin/clang justmain.c -pie -fPIE \ -fuse-ld=bfd \ -B ~/android/ndk/out/binutils/linux/arm64/install/binutils-arm64-linux/aarch64-linux-android/bin && \ readelf -d a.out | grep FLAG -- OUTPUT: nothing Change-Id: I040b6edbd8d7943b790db0ef19b76cfdffc1ccdf - Merge "Fix more mac build probably." - Fix more mac build probably. Test: None because mac Bug: None Change-Id: I1e91ad3df298b399f15c39708f79f02758b1689e - Merge "Fix Darwin compiler name." - Fix Darwin compiler name. Test: None because mac Bug: None Change-Id: If5844c790b0a14e8a6a88d1cd89ecbec5670e1f8 Exempt-From-Owner-Approval: build fix - Make sure binutils is stripped. 600MB of binutils per arch is a bit much. Test: file out/.../bin/aarch64-linux-android-ld.gold Bug: None Change-Id: I613dfd5f433d0a83269ef4dfcfe98a499f9ba8dc - Add a script for building just binutils. In contrast to building binutils via the GCC build, each target here takes only 1 minute instead of 10. Given that we've stopped supporting GCC, it's also nice to not have to rebuild something that shouldn't have changed anyway. This also has the advantage of building to a specific location in the out directory rather than /tmp, meaning it's easy to cd into the build directory and just run make rather than rerunning the full build script. Test: ./build.py for all architectures, linux, win, win64 Bug: None Change-Id: I067d84c5439c56004fc12de496f8f66fba7f7bf7 - gold: fix PR gold/21868 - internal error in fix_errata_and_relocate_erratum_stubs. am: 6e65e8d51c am: fbc6a65131 am: 31d16cab9d Change-Id: I32f53b7fae36af11b45ba85ce2d4a7844309fc9f - gold: don't install branch-to-stub for TLS relaxed ERRATUM 843419 sequences on AArch64 am: 1ea3c286b3 am: b3ef62be6d am: 2ec6b16a09 Change-Id: Id84ee80ab4a47428e9fcf810ab0eff3966b21ca7 - gold: fix PR gold/21868 - internal error in fix_errata_and_relocate_erratum_stubs. am: 6e65e8d51c am: fbc6a65131 Change-Id: Iebfebbb0591e65ac2489e56bab31464fd93ff83a - gold: don't install branch-to-stub for TLS relaxed ERRATUM 843419 sequences on AArch64 am: 1ea3c286b3 am: b3ef62be6d Change-Id: I513a638d857447b4e7e07c81cc9d924612d27bce - gold: fix PR gold/21868 - internal error in fix_errata_and_relocate_erratum_stubs. am: 6e65e8d51c Change-Id: Ieb1b1791ac9f4ce41b0f61416110744dce32f8f1 - gold: don't install branch-to-stub for TLS relaxed ERRATUM 843419 sequences on AArch64 am: 1ea3c286b3 Change-Id: I135094704d04ab61bd83c6bde472f8b0d549b85d - gold: fix PR gold/21868 - internal error in fix_errata_and_relocate_erratum_stubs. PR gold/21868 * aarch64.cc (AArch64_relobj::try_fix_erratum_843419_optimized): Add extra view offset argument to function. (AArch64_relobj::fix_errata_and_relocate_erratum_stubs): Add extra view offset set to the output offset when the view has is_input_output_view set, since it has not already been included. Pass this to try_fix_erratum_843419_optimized. This change is backport of commit 972d8a18db78974f59e1a6b1dc02f7e5b7d226d2 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=972d8a18db78974f59e1a6b1dc02f7e5b7d226d2 to binutils-2.27. Change-Id: Ief7dcc5743feb04d090eaac9b677abe568ca1268 - gold: don't install branch-to-stub for TLS relaxed ERRATUM 843419 sequences on AArch64 TLS relaxation may change erratum 843419 sequences that those offending ADRP instructions actually transformed into other instructions in which case there is erratum 843419 risk anymore that we should avoid installing unnecessary branch-to-stub. * aarch64.cc (Insn_utilities::is_mrs_tpidr_el0): New method. (AArch64_relobj<size, big_endian>::try_fix_erratum_843419_optimized): Return ture for some TLS relaxed sequences. This change is backport of commit 37de058ab2e9619fbb6dea52ec2773a5d65619c4 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=37de058ab2e9619fbb6dea52ec2773a5d65619c4 to binutils-2.27. Change-Id: I47a89d94ff8a0838b3d2ff9be41d9e98bfd59e85 - bfd: use a temporary variable to convert 'const char*' to 'char *'. am: 53dd00a1a3 am: 82a0970264 am: de307b61f3 Change-Id: Ic71902c761e86686d25c5a84a7f99c63a26a50d6 - bfd: use a temporary variable to convert 'const char*' to 'char *'. am: 53dd00a1a3 am: 82a0970264 Change-Id: If9b02db8cc06962b747e8293ae84eb18b7da054c - bfd: use a temporary variable to convert 'const char*' to 'char *'. am: 53dd00a1a3 Change-Id: I1a86c7d36ec3a1108dff12c24664acb1fa640d14 - bfd: use a temporary variable to convert 'const char*' to 'char *'. win_arm and win_arm64 builds are failing due to the compiler complaining that passing argument 7 of 'elf32_arm_create_stub' discards qualifiers from pointer target type. This change hopefully fixes those errors. Bug: 37683243 Test: './toolchain/gcc/build.py --host=windows' works. Change-Id: I397f876fb23e9b4a1479daffcc95e5d894b22919 - Merge "gas: explicit cast between pointer and integer of different size." am: 4017c42d6e am: cbdfd753e1 am: 7da921a376 Change-Id: Ic472a2c478b5bb4a993e9cebb4d5c1c670b4e420 - Merge "gas: explicit cast between pointer and integer of different size." am: 4017c42d6e am: cbdfd753e1 Change-Id: I4446f2dabbd397ca9afcc0425534a7c8601e4973 - Merge "gas: explicit cast between pointer and integer of different size." am: 4017c42d6e Change-Id: Ifa020fdf1f874210297abfdad3108ddc42abab98 - Merge "gas: explicit cast between pointer and integer of different size." - opcodes: initialize variable before use. am: 4abbf7de92 am: eb2c225267 am: f3e0802a9a Change-Id: I464b0381838ebeceac57c840582875434538ff01 - opcodes: initialize variable before use. am: 4abbf7de92 am: eb2c225267 Change-Id: I293537d64496a6cab7fb615c362c4c26e4f8e318 - opcodes: initialize variable before use. am: 4abbf7de92 Change-Id: I7914942674a104a9e2fdb37e4383dcbb4a537934 - opcodes: initialize variable before use. This fixes build errors due to the compiler complaining that 'imm' may be used uninitialized in function 'expand_fp_imm'. Bug: 37683243 Test: './toolchain/gcc/build.py --host=windows' works. Change-Id: I3c6b3a97255d647b3227f67f18193e9d5186a572 - gas: explicit cast between pointer and integer of different size. This fixes build errors for win_x86_64 and win_arm64 toolchains, where pointer and integer are different sizes. Bug: 37683243 Test: './toolchain/gcc/build.py --host=windows' works. Change-Id: I610707804476196e6de61587cc57385ca7a168e3 - Merge "as, ld, nm: disable sbrk() calls on Darwin." am: 3550577e2e am: f3e61642bb am: 2c7e9f6241 Change-Id: I0bb170e3a81d19b01e74fdb0681c21f47c18a221 - Merge "gold: use format macros from <inttypes.h>" am: 1ab36ab461 am: 26cd4d6ff4 am: ec636530e5 Change-Id: I862166ca84c82b16eba12ab61da3e882965a0f1c - gold: do not use extended initializer lists on Darwin. am: 697ae2a06e am: 2140ec53f3 am: 349c3035c5 Change-Id: Ic3a7422b74dfe09daeab1b44260cbd9a57d18806 - Merge "as, ld, nm: disable sbrk() calls on Darwin." am: 3550577e2e am: f3e61642bb Change-Id: I82554ba04107879d26171607c36ff918e2e6ee7b - Merge "gold: use format macros from <inttypes.h>" am: 1ab36ab461 am: 26cd4d6ff4 Change-Id: Id0a52b591f0936c5434d09488adb3adf84df0700 - gold: do not use extended initializer lists on Darwin. am: 697ae2a06e am: 2140ec53f3 Change-Id: I8f520ab13fbd6eaab719214f28bc71d4700e8616 - Merge "as, ld, nm: disable sbrk() calls on Darwin." am: 3550577e2e Change-Id: I9ab78c6276d27115c98365f7ce829f31a52c4f7e - Merge "gold: use format macros from <inttypes.h>" am: 1ab36ab461 Change-Id: I0a40e1556a4e74006b5493d178fbacf8d6f88840 - gold: do not use extended initializer lists on Darwin. am: 697ae2a06e Change-Id: I01ec4140ea331f9109e22591204aa9f9e1eb8cba - Merge "as, ld, nm: disable sbrk() calls on Darwin." - Merge "gold: use format macros from <inttypes.h>" - gold: do not use extended initializer lists on Darwin. On Darwin, PTHREAD_ONCE_INIT is {0x30B1BCBA, {0}} and GCC < 4.4 doesn't support extended initializer lists. This fixes build failures on Darwin, where the gcc/g++ version used is 4.2.1. Bug: 37683243 Test: binutils-2.27 builds successfully on Darwin. Change-Id: I8e09a8886ea8ef69c90e7ec5513fbf106d3c4606 - gold: use format macros from <inttypes.h> This fixes build failures on Darwin, where the compiler complains about using '%ld' format for uint64_t values. Bug: 37683243 Test: binutils-2.27 builds successfully on Darwin. Change-Id: I24d257e43d595e27c292986853e5ce846cc56a14 - as, ld, nm: disable sbrk() calls on Darwin. sbrk() is declared as deprecated in "/usr/include/unistd.h" on Darwin. This causes build errors when building binutils. Configure detects that sbrk() is present and defines HAVE_SBRK, but the compiler sees __deprecated attribute on the declaration and errors out. Bug: 37683243 Test: binutils-2.27 builds successfully on Darwin. Change-Id: I5baad79e19f49c5ea8f657173070382f8504dbd1 - Move OWNERS file to top level. am: e97411a56d am: 91fae7ed5d am: 9ad67ad7b3 Change-Id: I36fc39dbeb560d37d5985bb6851de23a2aa27cf2 - Move OWNERS file to top level. am: e97411a56d am: 91fae7ed5d Change-Id: Iaa57296b760a47ba2114a3ee8856845b2a3013a8 - Move OWNERS file to top level. am: e97411a56d Change-Id: I2d0d1d578cdad6a497a18e8601872e5ad3bc8221 - resolve merge conflicts of 36b7a6f6 to stage-aosp-master am: 7f335ef2f6 am: 9e59ab47b6 Change-Id: Icca3defbc2a4b6c892e6a1cbccc67f75d2180502 - Move OWNERS file to top level. The OWNERS file accidentally got moved to binutils-2.27 subdirectory during the merge of binutils-2_27-branch. Change-Id: I6e6e66d75cea608954068ccf3eb09b4018204f05 - resolve merge conflicts of 36b7a6f6 to stage-aosp-master am: 7f335ef2f6 Change-Id: If22483bf04f36ca23f93ff867f80741b7873eb6c - resolve merge conflicts of 36b7a6f6 to stage-aosp-master Test: None - Merge binutils-2_27-branch into master. After this merge, the tree on master branch is identical to the tree in binutils-2_27-branch, but moved to a binutils-2.27 sub- directory. The old binutils-2.25 subdirectory has been removed. Bug: 37683243 Test: ./ndk/checkbuild.py passed. Test: ./toolchain/gcc/build.py passed and built binutils-2.27. Change-Id: I5bacb1bff44b19845133f3344cb6ff26eb3616f6 - Improve Windows dlfcn shims. We can use GetLastError/FormatMessage to get a less useless error message from dlerror. Use LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR to search the loaded library's directory to satisfy dependencies. Test: toolchain/gcc/build.py --toolchain arm-linux-androideabi \ --host windows64 Bug: https://github.com/android-ndk/ndk/issues/313 This change is forward-port of c/438069 - https://android-review.googlesource.com/#/c/438069 to binutils-2_27-branch. Change-Id: I66840280cdd7b4176a1ad02f022457bd0336d101 - Improve Windows dlfcn shims. am: e574f15757 am: 5318987751 am: 43d3408243 am: ca1203218b Change-Id: Ia2c53f2876065f936556331579cb87e705417ad5 - Improve Windows dlfcn shims. am: e574f15757 am: 5318987751 am: 43d3408243 Change-Id: Idf119a22dba08e188059e44af6a92f33202252c9 - Improve Windows dlfcn shims. am: e574f15757 am: 5318987751 Change-Id: I1208f8e67fd567a2505bf7efb5013934c7cb025d - Improve Windows dlfcn shims. am: e574f15757 Change-Id: I4dfa0336503e265e200d879a0bce774b1bf0d938 - Improve Windows dlfcn shims. We can use GetLastError/FormatMessage to get a less useless error message from dlerror. Use LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR to search the loaded library's directory to satisfy dependencies. Test: toolchain/gcc/build.py --toolchain arm-linux-androideabi \ --host windows64 Bug: https://github.com/android-ndk/ndk/issues/313 Change-Id: Ia54e75b2ccbb6a4860e1d3e6250468ea053a4ce5 - Add OWNERS file. Change-Id: I716a9ed8376b85b6f7f850f90d213bf514a73f11 - gold: fix PR gold/21491 - errata workaround can produce broken images. The problem is caused by the fact that gold is relocating the stubs for an entire output section when it processes the relocations for a particular input section that happened to be designated as the stub table "owner". The Relocate_task for that input section may or may not run before the Relocate_task for another input section that contains the code that needs the erratum fix, but doesn't "own" the stub table. If it runs before (or might even race with) that other task, it ends up with a copy of the unrelocated original instruction. In other words - when calling fix_errata() from do_relocate_sections(), gold is going through the list of errata stubs that are associated only with that object. This routine updates the stored original instruction and replaces it in the output view with a branch to the stub. Later, as gold is going through the object file's input sections, it then checks for stub tables "owned" by each input section, and writes out all the stubs from that stub table, regardless of what object file each stub is associated with. Fixed by relocating the erratum stub only after the corresponding errata spot is fixed. That is to have fix_errata() call Stub_table::relocate_erratum_stub() for each stub. PR gold/21491 * aarch64.cc (Erratum_stub::invalidate_erratum_stub): New method. (Erratum_stub::is_invalidated_erratum_stub): New method. (Stub_table::relocate_reloc_stub): Renamed from "relocate_stub". (Stub_table::relocate_reloc_stubs): Renamed from "relocate_stubs". (Stub_table::relocate_erratum_stub): New method. (AArch64_relobj::fix_errata_and_relocate_erratum_stubs): Renamed from "fix_errata". (Target_aarch64::relocate_reloc_stub): Renamed from "relocate_stub". This change is backport of commit df2f63a6a0fc19c54e58aab8afe262baf3cb1a3c - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=df2f63a6a0fc19c54e58aab8afe262baf3cb1a3c to binutils-2_27-branch. Change-Id: I1f70f82f0330b4249589d05a86d5d9daac6e9b93 - gas: enable -mshared by default. From gas help: -mshared disable branch optimization for shared code. The default behavior is to optimize out non-PLT relocations against defined non-weak global branch targets with default visibility. This optimization has been a source of many issues during testing of new binutils: - https://bugs.chromium.org/p/chromium/issues/detail?id=738283 - https://bugs.chromium.org/p/chromium/issues/detail?id=723906 Change-Id: Id2b4970d2f73de80adaead81f43f7f88c83630cf - Make sure errata fix is done, whether or not flags are passed. am: f3d35cf659 am: aa1775f6b2 am: 98fcb1fc0b am: 33520f9b79 Change-Id: I9ad6933ad61b811c8e8ea9f102b16ab5e60bcb43 - Make sure errata fix is done, whether or not flags are passed. am: f3d35cf659 am: aa1775f6b2 am: 98fcb1fc0b Change-Id: Ibe66a75736eb0b9a40d4b7827c4888a4f29625ae - Make sure errata fix is done, whether or not flags are passed. am: f3d35cf659 am: aa1775f6b2 Change-Id: Ia14e01b0d06385166f3a4c4113dd4cc669399bbc - Make sure errata fix is done, whether or not flags are passed. am: f3d35cf659 Change-Id: I02bfe785b1d756dfc5401b4acef60b05d943213f - Make sure errata fix is done, whether or not flags are passed. Currently the reloc stubs errata code will only be run if a fix-errata flag is passed to the linker. This CL makes sure the errata fix is applied, whether or not the linker flag is passed (this will prevent a runtime bug). Bug: https://b/63044552 Test: Built binutils for linux for all 4 architectures; built Angler image & kernel with updated binutils and tested them successfully on an Angler device. Change-Id: Ieafdc8a12ae78eee14efc5db3c6a64468fec125c - Merge "Merge "Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49" into stage-aosp-master am: 77b155b0b8 am: f000e4520b" into oc-dr1-dev-plus-aosp am: 314dd4ecad Change-Id: I9f236ff4ecef6275e083fac4b30cfc04875dbf40 - Merge "Merge "Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49" into stage-aosp-master am: 77b155b0b8 am: f000e4520b" into oc-dr1-dev-plus-aosp am: e5b56a867f Change-Id: Ic3d8340e5c8f1716a6d1a924163d2b01c4e9fbff - Merge "Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49 am: 8bb04269d7 am: 4a2e95641b" into oc-dr1-dev-plus-aosp am: 0149f698a6 Change-Id: I2ef14fbec115159da4ea5c01d2e405ae33fe42da - Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49 am: 8bb04269d7 am: 4a2e95641b am: bebc85fc50 Change-Id: I090ddb7495a8d35ecdab4e892435db9cc39d1c9c - Merge "Merge "Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49" into stage-aosp-master am: 77b155b0b8 am: f000e4520b" into oc-dr1-dev-plus-aosp - Merge "Merge "Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49" into stage-aosp-master am: 77b155b0b8 am: f000e4520b" into oc-dr1-dev-plus-aosp - Merge "Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49" into stage-aosp-master am: 77b155b0b8 am: f000e4520b Change-Id: Id80a28a8790e08c5584839c4b6e44b9de64c983c - Merge "Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49" into stage-aosp-master am: 77b155b0b8 am: f000e4520b Change-Id: I17a3c2e66d2a49fb09f936c2ca283e760749598b - Merge "Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49 am: 8bb04269d7 am: 4a2e95641b" into oc-dr1-dev-plus-aosp - Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49 am: 8bb04269d7 am: 4a2e95641b Change-Id: I69b3ffa5ce0b79482c2fa485bf10fdb945bb9faf - Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49 am: 8bb04269d7 am: 4a2e95641b Change-Id: I3fbd665159cd936e75017fb704f53f3aa4c8dd1e - Merge "Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49" into stage-aosp-master am: 77b155b0b8 Change-Id: I8e2422c9f2b7897e806daf27a5f46243c5b01cbd - Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49 am: 8bb04269d7 Change-Id: Ic147d95eb1db75302e65b2d40176d4d0b98053b5 - Merge "Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49" into stage-aosp-master - Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49 Change-Id: I2ab4f613131cf6d4e66ab5659380e0cac2171f2b - Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49 Change-Id: I4af1b12b153f901df12a8e59475f8514892a3e29 - Add rest of toolchain team to OWNERS file. Bug: None Test: None Change-Id: I8df1a23277511e415fbfcdca031adb8426faebeb - Merge "Merge "Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574" into stage-aosp-master am: 2062d0dfc8 am: 1aa199f9ed" into oc-dr1-dev-plus-aosp am: d8a8c2bb3a Change-Id: Id86a21f4233bc27b29beb4876b3d9c4f2e4a1144 - Merge "Merge "Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574" into stage-aosp-master am: 2062d0dfc8 am: 1aa199f9ed" into oc-dr1-dev-plus-aosp am: a818858f82 Change-Id: I7f5ad827f3ccd10d0882cf845ad6cabcdd3afe64 - Merge "Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574 am: 6ae1b21657 am: 18bcd8df3f" into oc-dr1-dev-plus-aosp am: 3e94cbac1e Change-Id: I9f586e155bcae9d27d41eb4d01111fd4efcc2995 - Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574 am: 6ae1b21657 am: 18bcd8df3f am: 1ce80156f9 Change-Id: If563f8416e4e7c57825889ff8fc6b003ced39655 - Merge "Merge "Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574" into stage-aosp-master am: 2062d0dfc8 am: 1aa199f9ed" into oc-dr1-dev-plus-aosp - Merge "Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574" into stage-aosp-master am: 2062d0dfc8 am: 1aa199f9ed Change-Id: I111d52339888c84a9ee219bdd7e8b4193fce527c - Merge "Merge "Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574" into stage-aosp-master am: 2062d0dfc8 am: 1aa199f9ed" into oc-dr1-dev-plus-aosp - Merge "Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574 am: 6ae1b21657 am: 18bcd8df3f" into oc-dr1-dev-plus-aosp - Merge "Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574" into stage-aosp-master am: 2062d0dfc8 am: 1aa199f9ed Change-Id: I9d03be7a330cb89d8e0abeb33b337dfc36a4f565 - Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574 am: 6ae1b21657 am: 18bcd8df3f Change-Id: I9df99fe8c722654db37136b1a7bc0d92471b3f0c - Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574 am: 6ae1b21657 am: 18bcd8df3f Change-Id: I29d7c37809fe4c3312c81c97187747b06f3065a5 - Merge "Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574" into stage-aosp-master am: 2062d0dfc8 Change-Id: I3a7f9cf0c38527ae1b158c0aa735a07a0ffefdf1 - Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574 am: 6ae1b21657 Change-Id: Iec49e785302e984ee3592fa276deb4a7a5f52b19 - Merge "Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574" into stage-aosp-master - Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574 Change-Id: I7bdd5e39787071a5830b9e2b997004e81a5d8f13 - Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574 Change-Id: Idc2da4a5e208c54e404adca208e568be1ae65e39 - Merge "Fix the binutils issue for Mac builds (duplicate definitions)." - Fix the binutils issue for Mac builds (duplicate definitions). Bug: http://b/63044552 Test: In progress... Change-Id: I93be2f6931194a978b5bc80a77e1a4a378e5b4ea - Merge "Merge "Apply upstream binutils patch to fix LTO issue with gold." am: ea6b4aa0f2" into stage-aosp-master am: c4a46d96de am: 866219a039 am: 3054b44a23 Change-Id: I5fa2ed47819b2ad5d753d61784067c9fd83d39ae - Merge "Apply upstream binutils patch to fix LTO issue with gold." am: ea6b4aa0f2 am: 8f49b83734 am: 9940a0057e am: b9df147b61 Change-Id: I51b599096c79a3e5d6b9f304f47aa2f52c572823 - Add Luis and Caroline to the OWNERS file. am: 9b20d56a93 am: f21890e8da am: 1753ebf7cf am: f4e528afc8 Change-Id: I98c0593c1a65dacc487b29659d9d455bca046a8f - Merge "Merge "Apply upstream binutils patch to fix LTO issue with gold." am: ea6b4aa0f2" into stage-aosp-master am: c4a46d96de am: 866219a039 Change-Id: Ieda39dd1d1e46338fa70cd6be83eb666b7ba01f5 - Merge "Apply upstream binutils patch to fix LTO issue with gold." am: ea6b4aa0f2 am: 8f49b83734 am: 9940a0057e Change-Id: I5422467d419e294850cb60cce9035992133b08c1 - Add Luis and Caroline to the OWNERS file. am: 9b20d56a93 am: f21890e8da am: 1753ebf7cf Change-Id: I4f425ecd79ce4baeedf698343aac7f8036109d0f - Merge "Merge "Apply upstream binutils patch to fix LTO issue with gold." am: ea6b4aa0f2" into stage-aosp-master am: c4a46d96de Change-Id: If0052b482e3d8c56eda738a9a090acf4870f2b00 - Merge "Apply upstream binutils patch to fix LTO issue with gold." am: ea6b4aa0f2 am: 8f49b83734 Change-Id: I036ac38f98d056a53d9c09a51fee50d1d5e95aa3 - Add Luis and Caroline to the OWNERS file. am: 9b20d56a93 am: f21890e8da Change-Id: Idf5b797ca8a04f7962cb225dfcd8472e8d2d5b59 - Merge "Merge "Apply upstream binutils patch to fix LTO issue with gold." am: ea6b4aa0f2" into stage-aosp-master - Merge "Apply upstream binutils patch to fix LTO issue with gold." am: ea6b4aa0f2 Change-Id: Ib587b49d2ad3dc99b00ea042451ee1ab94916e62 - Merge "Apply upstream binutils patch to fix LTO issue with gold." am: ea6b4aa0f2 Change-Id: I0f197669e7b3dc6b4f270e13615d0935eaf9123e - Add Luis and Caroline to the OWNERS file. am: 9b20d56a93 Change-Id: Ib48ad52abe119e82a2dcf706a57ba48371e10ea4 - Merge "Apply upstream binutils patch to fix LTO issue with gold." - Add Luis and Caroline to the OWNERS file. Change-Id: I3c48187ebd42ea21876fc407e5e1c04ba6911b74 Exempt-From-Owner-Approval: Rahul is OOO. Test: None - Apply upstream binutils patch to fix LTO issue with gold. This CL applies a patch from upstream binutils 2.25 that fixes the problem with Gold and LTO. Bug: http://b/63044552 Test: Built all platform source tree for all Android architectures; pushed Angler build onto device & tested device. Change-Id: Ief343f499d9b3508eb0e725dc78729f9c01320d0 - Add OWNERS in toolchain/binutils am: 1661a29f47 am: 79c2159ff0 am: d10b2d2c7d am: 1f5920befa Change-Id: Ia0ccd25ef07a66a6898f0b36327f7aa76e926334 - Add OWNERS in toolchain/binutils am: 1661a29f47 am: 79c2159ff0 am: d10b2d2c7d Change-Id: Iabbf68467536ac22aa2d10ee0754b252c30ae321 - Add OWNERS in toolchain/binutils am: 1661a29f47 am: 79c2159ff0 Change-Id: Ie59b3aa7dbf677226418d5516f239357465a5216 - Add OWNERS in toolchain/binutils am: 1661a29f47 Change-Id: Idf9b0c2dd05b6f339ff0ecafe321a526dec1954d - Add OWNERS in toolchain/binutils * Owners are selected from top CL approvals or owners. They will be suggested to review/approve future CLs. * OWNERS files are recognized by the new find-owners plugin, see .md files in https://gerrit.googlesource.com/plugins/find-owners/+/master/src/main/resources/Documentation/ Test: build/make/tools/checkowners.py -c -v OWNERS Change-Id: Idca0efccab88a8ea744daf826f08945db5d1569b - [GAS/ARM] Fix expansion of ldr pseudo instruction The LDR rX, =cst pseudo-instruction suffers from two issues for loading integer constants in Thumb mode: - movs is used if the constant and register can be encoded using that instruction which leads to unexpected behavior due to its flag-setting behavior - mov.w, movw and mvn are used for r13 (sp) and r15 (pc) but these encoding are marked as UNPREDICTABLE This patch fixes those issues and update testing accordingly. 2017-04-24 Thomas Preud'homme <thomas.preudhomme@arm.com> gas/ * config/tc-arm.c (move_or_literal_pool): Remove code generating MOVS. Forbid MOV.W and MOVW if destination is SP or PC. * testsuite/gas/arm/thumb2_ldr_immediate_highregs_armv6t2.s: Explain expectation of LDR not generating a MOVS for low registers and small constants. Add tests of MOVW generation. * testsuite/gas/arm/thumb2_ldr_immediate_highregs_armv6t2.d: Update expected disassembly. (cherry picked from commit 534455547021f3262fa60d32cabb626af01692a3) - ld: revert two upstream commits related to interpretation of ".". This change reverts commits d2667025dd30611514810c28bee9709e4623012a and 975f8a9e3144e4d3d3f391e907c8bf94b23dc8b6 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=d2667025dd30611514810c28bee9709e4623012a - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=975f8a9e3144e4d3d3f391e907c8bf94b23dc8b6 from binutils-2_27-branch. Commit d2667025dd30611514810c28bee9709e4623012a (dated 2012-06-15) changed the interpretation of "." when it appears in an assignment statement outside of an output section statement. This change interacts with the linux kernel 3.8.* builds for amd64 and results in an unbootable kernel. This issue was introduced in binutils 2.23, and we have locally reverted this change on every upgrade since then. Commit 975f8a9e3144e4d3d3f391e907c8bf94b23dc8b6 (dated 2015-09-18) is a followup to d2667025dd30611514810c28bee9709e4623012a. It fixes pr/18963, which was caused by the first commit, by delaying some of the symbol value computations. - https://sourceware.org/bugzilla/show_bug.cgi?id=18963 Change-Id: I1eb6177d79206c8b321ccf0ee0c1e293fc94093b - gas: fix the generation of alignment frags in code sections for AArch64. PR gas/20364 * config/tc-aarch64.c (s_ltorg): Change the mapping state after aligning the frag. (aarch64_init): Treat rs_align frags in code sections as containing code, not data. * testsuite/gas/aarch64/pr20364.s: New test. * testsuite/gas/aarch64/pr20364.d: New test driver. This change is backport of commit 7ea12e5c3ad54da440c08f32da09534e63e515ca - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=7ea12e5c3ad54da440c08f32da09534e63e515ca to binutils-2_27-branch. Change-Id: I2635ae5a76de59a1a7f15b3319c4ad11f8e1c171 - gas: refine .cfi_sections check to only consider compact eh_frame. The .cfi_sections directive can be safely used multiple times with different sections named at any time unless the compact form of exception handling is requested after CFI information has been emitted. Only the compact form of CFI information changes the way in which CFI is generated and therefore cannot be retrospectively requested after generating CFI information. PR gas/20648 * dw2gencfi.c (dot_cfi_sections): Refine the check for inconsistent .cfi_sections to only consider compact vs non compact forms. * testsuite/gas/cfi/cfi-common-9.d: New file. * testsuite/gas/cfi/cfi-common-9.s: New file. * testsuite/gas/cfi/cfi.exp: Run new test. This change is backport of commit 3d3424e9a8d6ad56160b98bf6e223c0346164468 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=3d3424e9a8d6ad56160b98bf6e223c0346164468 to binutils-2_27-branch. Change-Id: I9540e21d876ef60899f5bda8023f80683e3ab94f - Fix bug where -u option with empty archive results in internal error. am: c808115817 am: 486ca67cc8 am: 19948f357a am: a9551f5dfc Change-Id: I94742aa9e974f557f726ddb4d2ac45cccd142d0c - gold: fix bug where -u option with empty archive results in internal error. PR gold/20693 * gold.cc (queue_middle_tasks): Force valid target earlier. This change is backport of commit c13b08dbbcf752480a7621aa1f89bc5440c74c25 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=c13b08dbbcf752480a7621aa1f89bc5440c74c25 to binutils-2_27-branch. Change-Id: I206f9c35ebc153cebd74e962382d8563936dfbcb - Fix bug where -u option with empty archive results in internal error. am: c808115817 am: 486ca67cc8 am: 19948f357a Change-Id: I0292bdf8d11f7e8b73c0d6c2eabd765415b7422b - Fix bug where -u option with empty archive results in internal error. am: c808115817 am: 486ca67cc8 Change-Id: Id40288912755128b681618198c939fe1c2fecb42 - Fix bug where -u option with empty archive results in internal error. am: c808115817 Change-Id: I4efa7dde689ae6c21d3586a48f31062da320a1fc - gold: improved support for --icf=safe when used with -pie. * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers): Return true even when building pie binaries. (Target_x86_64::possible_function_pointer_reloc): Check opcode for R_X86_64_PC32 relocations. (Target_x86_64::local_reloc_may_be_function_pointer): Pass extra arguments to local_reloc_may_be_function_pointer. (Target_x86_64::global_reloc_may_be_function_pointer): Likewise. * gc.h (gc_process_relocs): Add check for STT_FUNC. * testsuite/Makefile.am (icf_safe_pie_test): New test case. * testsuite/Makefile.in: Regenerate. * testsuite/icf_safe_pie_test.sh: New shell script. * testsuite/icf_safe_so_test.sh: Use "set -e". * testsuite/icf_safe_test.sh: Likewise. * testsuite/icf_test.sh: Likewise. This change is backport of commits 4aebb6312eb5dcd12f2f8420028547584b708907 and 741bcbe94d7811caa1efa500dacd047c428cce61 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=4aebb6312eb5dcd12f2f8420028547584b708907 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=741bcbe94d7811caa1efa500dacd047c428cce61 to binutils-2_27-branch. Change-Id: I605cd24cadc781bc481807efd99a096657662310 - gold: make icf respect section alignment requirements. Fix PR 17704. This fix keeps the section with the highest alignment when folding sections with ICF. PR gold/17704 * icf.cc (match_sections): Add new parameter section_addraligns. Check section alignment and keep the section with the strictest alignment. (find_identical_sections): New local variable section_addraligns. Store each section's alignment. * testsuite/pr17704a_test.s: New file. * testsuite/Makefile.am (pr17704a_test): New test. * testsuite/Makefile.in: Regenerate. This change is backport of commit ac423761af22f7858a1413cda5df3e1d5e88d4e4 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ac423761af22f7858a1413cda5df3e1d5e88d4e4 to binutils-2_27-branch. Change-Id: Ifef78a2c27e3ed70b9649b1bc44f7871eac07d66 - ld: set CodeView pdb path/name to base name. The CodeView pdb path/name field is empty leading windows minidumps to have empty module paths for the binary. This patch sets the path to the base name of the binary. This change is forward-port of c/314988 - https://android-review.googlesource.com/#/c/314988 to binutils-2_27-branch. Change-Id: Ic903fbcd360860e644893b8b22e0fa50f2022415 - gold: exit without segfault if the binary is not built with debug fission. This change is forward-port of c/230470 - https://android-review.googlesource.com/#/c/230470 to binutils-2_27-branch. Change-Id: Ic06ad39f56ca16e1eec9123f29daab4d63df2ed2 - gold: make --no-apply-dynamic-relocs the default. This change is forward-port of c/196731 - https://android-review.googlesource.com/#/c/196731 to binutils-2_27-branch. The rest of the patch was commited to master branch as 0eccf19f96d6218dd7c2f8d13f0546c2b942cc08 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=0eccf19f96d6218dd7c2f8d13f0546c2b942cc08 and is already included in binutils-2_27-branch. Change-Id: I081b48bf1535ea227c0c3fb01ce8e417c8ded0e4 - gold: add description to warning about unsafe data segment size for PIE. This change is forward-port of c/195802 - https://android-review.googlesource.com/#/c/195802 to binutils-2_27-branch. Change-Id: I568b5fe1105ad0955166b5d8929dc07a1a327c73 - gas: silence ARM as error "MOV Rd, Rs" two low regs with clang/armv5/thumb1. This change is forward-port of commit b33d0ddc123435be5e60ebb15a37b3bfb651dc7e - https://android.googlesource.com/toolchain/binutils/+/b33d0ddc123435be5e60ebb15a37b3bfb651dc7e to binutils-2_27-branch. For more details, see commit message for 92337cf27b1497415e3f345ea9292e96ced2a8fa - https://android.googlesource.com/toolchain/binutils/+/92337cf27b1497415e3f345ea9292e96ced2a8fa Change-Id: I78d77dce19710b86b6de0201082cac50fa70d59f - bfd: do not assert if tag_FP_arch does not exist. This change is forward-port of commit 1000fadfaa979b623e1fbd0c87858be4f5b6dffd - https://android.googlesource.com/toolchain/binutils/+/1000fadfaa979b623e1fbd0c87858be4f5b6dffd to binutils-2_27-branch. Change-Id: I9937bc22d4de2ebdd79eb3f52a4137c7b89abacb - gold: add 'smart padding' support for stub table (arm). This change adds support for 'smart padding' (default ON) for stub table, which reduces up to 50% of relaxation time on large objects. This change is forward-port of c/275313 - https://chromium-review.googlesource.com/#/c/275313 to binutils-2_27-branch. Change-Id: I76017cc50f1c456817031fbc87d8c49edbc7d70c - gold/ld: add support for poisoned system directories. This is based on the old CodeSourcery patch written by Joseph Myers to add support to the link for detecting & rejecting bad -L paths when using a cross-compiler. The differences here: * The command line flags are always available. * We can turn on & off the warning via the command line. * The configure option controls the default warning behavior. * Add support for gold. This change is forward-port of c/272083 and c/272716 - https://chromium-review.googlesource.com/#/c/272083 - https://chromium-review.googlesource.com/#/c/272716 to binutils-2_27-branch. Change-Id: I55600382e41d4987ecdb3c9d6a6eaf969ecac37c - gas: enable .incbin directive by default. This change is forward-port of c/273909 - https://chromium-review.googlesource.com/#/c/273909 to binutils-2_27-branch. Change-Id: Id9e9d3f39c49c28b0216e1e5026912b8c4dc47e2 - gold: account for GOT and DYNAMIC sections when estimating data segment size. This change is forward-port of google cl/95766599, cl/97694136, and cl/122164147 to binutils-2_27-branch. Change-Id: I21698aeec4a67d16b90e8707d78d04e688f37a42 - gold: disable PIE if data segment size is more than the safe value. This change is forward-port of google cl/93067133 to binutils-2_27-branch. Change-Id: I6ed96f1ea013b77d8ff7b5cb799552c7a6c0ecbf - gold: warn if data segment size is more than the safe value with PIE links. This change is forward-port of google cl/91421998 and cl/91423363 to binutils-2_27-branch. Change-Id: Iacb625fb1b58b06292bdc0ffa520ecc165afc9cf - gold: fix debug output to print correct context. This change is forward-port of commit ac2a5ee857c267a3003c9db3e1a3219f1c6f122d - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ac2a5ee857c267a3003c9db3e1a3219f1c6f122d from upstream branch users/ccoutant/two-level-line-150331 - https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/users/ccoutant/two-level-line-150331 to binutils-2_27-branch. The rest of the patch was commited to master branch as 437ddf0c4cb63fdb68c4bd1cc155144db344d0c5 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=437ddf0c4cb63fdb68c4bd1cc155144db344d0c5 and is already included in binutils-2_27-branch. Change-Id: Icbe2e8eb911f77d14e7e95bc307bafab6f4d564e - gold: add support for two-level line tables. This change is forward-port of commit 2cd0390339e0f7b5cd6353f1f86aa6ceb0fb3536 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=2cd0390339e0f7b5cd6353f1f86aa6ceb0fb3536 from upstream branch users/ccoutant/two-level-line-150331 - https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/users/ccoutant/two-level-line-150331 to binutils-2_27-branch. Change-Id: I3315121377bdfa9b1e7a75efa87d4098db4b1f4a - readelf: add support for DWARF-5 and experimental two-level line number tables. This change is forward-port of commit d80608344a0908445af29b6db5266394c0376076 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=d80608344a0908445af29b6db5266394c0376076 from upstream branch users/ccoutant/two-level-line-150331 - https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/users/ccoutant/two-level-line-150331 to binutils-2_27-branch. Change-Id: Ia3e680ceb384e8ce8aed4d5aee72de48e415fefd - gas: add support for DWARF-5 and experimental two-level line number tables. This change is forward-port of commit a7c7bcafd2add7ecf8ea2ad7d3d77cf38d46c195 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=a7c7bcafd2add7ecf8ea2ad7d3d77cf38d46c195 from upstream branch users/ccoutant/two-level-line-150331 - https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/users/ccoutant/two-level-line-150331 to binutils-2_27-branch. Change-Id: I070d675b2403325fe3087be71b158ff765a8aab1 - dwarf: add experimental DWARF-5 values for two-level line number tables. This change is forward-port of commit 13a142ce0959837746e61063b6b18ac70344a474 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=13a142ce0959837746e61063b6b18ac70344a474 from upstream branch users/ccoutant/two-level-line-150331 - https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/users/ccoutant/two-level-line-150331 to binutils-2_27-branch. Change-Id: I6086897f3482d3082b9eaf54d9e440a06e9e20ba - gold: map input section name prefixes. Map input section name prefixes "_function_patch_prologue." and "_function_patch_epilogue." to output section names "_function_patch_prologue" and "_function_patch_epilogue". The compiler patch that creates these sections: - http://gcc.gnu.org/ml/gcc-patches/2013-04/msg01835.html This change is forward-port of google cl/80649796 to binutils-2_27-branch. Change-Id: I9a887cf06d8e0fa9eec413b22c39750e0a5fbd86 - gas: disable .incbin, unless explicitly enabled with --allow-incbin. This change is forward-port of google cl/80426738 and cl/80451836 to binutils-2_27-branch. Change-Id: I8447d13c4c46ebd807162d60f251e6bd4890f5b9 - Update date in version.in All changes on binutils-2_27-branch in the upstream binutils repository up to and including 2017-03-15 have been imported. - https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/binutils-2_27-branch Change-Id: I1273ab3ccf8c74029a2e372ed1ee33a530499f5d - Import binutils-2_27 from upstream. This CL imports the current tip of binutils-2_27-branch from upstream binutils repository (https://sourceware.org/git/binutils-gdb.git). It does not import the full history from upstream. Instead, the top level binutils-2.25/ directory in this repository was deleted, and the contents of the tree from the upstream repository were copied here at top level (no binutils-2.27/ subdirectory). The origin commit used for the copy is b5d3ac25628b1a16409a9816623c34a45377d400 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=b5d3ac25628b1a16409a9816623c34a45377d400 on binutils-2_27-branch - https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/binutils-2_27-branch After the initial copy, these four top-level directories were expunged: gdb, sim, readline, and libdecnumber. These are extra components in the upstream binutils repository that we do not build or need. Change-Id: I61be5898baf69579ff9e57f0d0bd177d4d048ad0 - Set CodeView pdb path/name to base name am: 9bf6cbf6dd am: 22eb558f95 am: 29a2cb0cb5 am: 07fbdd68b5 Change-Id: Ibcb7e035ae2f1df3d30b69f0cda7445cbf8c712c - gold: enable new dtags by default. am: 082ed0f10c am: 249bab53c3 am: 8c02016831 am: fc509c90be Change-Id: I9bbedc88e2bb5a0c814885935e833adb9054837d - gold: make icf respect section alignment requirements. am: b8ff982870 am: 61e5c70588 am: 9143ccb606 am: 77490142d3 Change-Id: I34d2cf8ec9c83195da8678af392b7f3ae44e4034 - Remove warning about references from shared objects to hidden symbols. am: 6422a80df9 am: 129dec3ed0 am: 1e1ca302a3 am: 2ef2302e32 Change-Id: Id1c859a21e8fed66270377cd8359e2776095e60e - Revert \\\\"Disable the warning of a hidden symbol matches a reference to be resolved.\\\\" am: 4520d6bee1 am: fd48d3412a am: 850063a5c4 am: ab16853a21 Change-Id: I9d457b3ce76c3a9852e0b690f8972a6946d8018a - GOLD/DWP: exit without segfault if the binary is not built with debug fission. am: 21efffa54e am: 881d3cd754 am: cc160c2199 am: 237115ae12 * commit '237115ae1298fde679c81e1ba92a34e20344680f': GOLD/DWP: exit without segfault if the binary is not built with debug fission. Change-Id: I7a92165d73a594717aaa76db61690a81a897b89f - Fix DT_MIPS_RLD_MAP_REL tag for n64 target and 32-bit host. am: d929cfd am: 1966aef am: 2b51ecb am: 9adf19b * commit '9adf19b554748ec5150dfac4795890e5958006a9': Fix DT_MIPS_RLD_MAP_REL tag for n64 target and 32-bit host. Change-Id: I7839748703e117b2e8ec0921c2ebb0e7a8bca592 - Add support for DT_MIPS_RLD_MAP_REL. am: a696d1d am: 39f13fa am: 52d9ff8 am: 53b6c9f * commit '53b6c9f32834effacea9817cd699133c247971e4': Add support for DT_MIPS_RLD_MAP_REL. Change-Id: Id6355a0d8f80b3d7c7fe8869083b3cd27d802d30 - Revert "Add support for the new tag DT_MIPS_RLD_MAP2." am: 42704eb am: ba7ec7f am: 1e5714c am: 24efe7d * commit '24efe7d5478b7794b51a59dce3c0779c20a765d9': Revert "Add support for the new tag DT_MIPS_RLD_MAP2." Change-Id: I4e2443928c7215d40a3761fa6f0daf53a7bfae5a - Revert "Fix DT_MIPS_RLD_MAP_REL tag for n64 target and 32-bit host." am: 405fb1a am: 825d123 am: 3186005 am: 5200634 * commit '5200634678cedc14f5df394d94b48d9109ded34a': Revert "Fix DT_MIPS_RLD_MAP_REL tag for n64 target and 32-bit host." Change-Id: Ice6897f8b482e90e256fbc26522249ff108ca6bd - Backport upstream CL to fix x86_32 clang segfaults. am: 78eb680 am: 61706fc am: 3a9e390 * commit '3a9e39083fd33ed694b12b33f7f7371321bd77f0': Backport upstream CL to fix x86_32 clang segfaults. Change-Id: I4d65d422a5e2681f09630c969126218439f9d175
* Update toolchain/binutils from branch 'master' to fcb56510b39e391c76f4931a64d19569024fbf1d - Fix dwarf_reader.cc for C++11 This commit replaces `std::make_pair<int, std::string>(dirindex, path)` with `std::make_pair(dirindex, path)` because C++11 replaces `std::make_pair<T, V>(T t, V v)` with `std::make_pair<T, V>(T &&t, V &&v)`. This commit removes explicit template arguments because forward references are only available during template arguments deduction. If the explicit template arguments are specified, the argument `t` and `v` will become R-value references, which can not bind to an L-value. Test: It builds with clang++ (or g++) with CXXFLAGS="-std=c++11" Change-Id: I79eb94552445354f7e7bff02169879195c7f6283 - Add support for the Cortex-A55 and Cortex-A75 Based on upstream change 1e2926 and 15a769. Bug: 110235326 Change-Id: Ieee5ad4cfb0aa21b46e918191215c4ce12248661 - bfd: PR22829, objcopy/strip removes PT_GNU_RELRO from lld binaries lld lays out the relro segment differently to GNU ld, not bothering to include the first few bytes of .got.plt and padding out to a page at the end of the segment. This patch teaches binutils to recognize the different (and somewhat inferior) layout as valid. bfd/ PR 22829 * elf.c (assign_file_positions_for_non_load_sections): Rewrite PT_GNU_RELRO setup. ld/ * testsuite/ld-x86-64/pr14207.d: Adjust relro p_filesz. This change is backport of commit f2731e0c374e5323ce4cdae2bcc7b7fe22da1a6f - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=f2731e0c374e5323ce4cdae2bcc7b7fe22da1a6f to binutils-2.27. Change-Id: I9d598adb1a0ef4778f0f29d0faf19c7c8112a74a - Windows: enable gold threading, copy libwinpthread-1.dll Copy libwinpthread-1.dll alongside the binutils executables on Windows. The install_winpthreads function is copied from llvm_android: https://android.googlesource.com/toolchain/llvm_android/+/bd22d9779676661ae9571972dcd744c42c70ffd0/build.py#1063 Most C++ MinGW programs need libpthread, because even libstdc++'s "operator new" pulls in EH code, which calls into libpthread. Currently, the ld.gold.exe and dwp.exe binaries need libwinpthread-1.dll, which is not generally in the PATH, so the binaries don't run. Previously, the Android GCC build of binutils linked ld.gold.exe and dwp.exe with -static, which selected the static libpthread.a. Packaging libwinpthread-1.dll alongside the binaries ensures that ld.gold.exe and the LLVMgold plugin use the same copy of the winpthreads runtime, which might be important. Test: ./toolchain/binutils/build.py --arch arm64 --host win64 Test: ./toolchain/binutils/build.py --arch arm64 --host win Test: ./toolchain/binutils/build.py --arch arm64 --host linux Test: ./toolchain/binutils/build.py --arch x86 --host win64 Bug: none Change-Id: I5fc2d38b67c72fa4760be1c2688ef88479759160 - gold: fix build errors on darwin. Some cc files include both "gold.h" and "output.h", which makes the compiler on mac complain about redefinition of __STDC_FORMAT_MACROS. Change-Id: I11875d9b76d27449167485ae5f91f026acbda8e1 - gold: add support for relative relocations at odd offsets. If the relocation offset is odd, create the relocation in rela_dyn section instead of the relr_dyn section. Bug: None Test: Verified relocations after linking test binary with odd offset. Change-Id: If0d65176639bfb7401f7fb2dd43efc55c17670a4 - gold: better error message on seeing odd offset for RELR relocation. Print a more informative error message instead of asserting out. This prints errors for all the odd offsets before exiting gold. Bug: None Test: Verified error message on linking test binary with odd offset. Change-Id: Ib481a4983cac2e637b1128ea0559d9606e671c35 - Fix problem where undef can fail to trigger archive rescan. If a shared library contains an undefined symbol and LTO adds a new reference to that same undefined symbol, the reference in the new object added by the plugin would not trigger a rescan of the archive containing the symbol. 2017-11-17 Stephen Crane <sjc@immunant.com> gold/ PR gold/22448 * symtab.cc (Symbol_table::add_from_object): Only rescan for undefined symbols in regular, not dynamic, objects. This change is backport of commit 71739b698d47945463f183619078ff680c277f0f - https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=71739b698d47945463f183619078ff680c277f0f to binutils-2.27. Change-Id: I9d926d8c56b02601785e18c88ef886ed2433c25b - Build binutils with --disable-nls The --disable-nls flag is also used to build gdb and gcc for Android. Adding it here prevents 428 *.mo files from being added to the next NDK release. (AFAICT, the SDK and NDK currently have no *.mo files.) It also fixes a sporadic build failure that can happen when binutils needs its bundled copy of libintl/gettext (see build 4635300 of ab/aosp-binutils or the linked issue). Test: ./toolchain/binutils/build.py --arch arm --host win Test: ./toolchain/binutils/build.py --arch arm --host win64 Test: ./toolchain/binutils/build.py --arch arm --host linux Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=22941 Change-Id: I0810406dc52f366fac7491676c2d5cb000fcfcaa - Upgrade Linux host toolchain from glibc 2.11 to 2.15 Bug: b/73539603 Test: ./toolchain/binutils/build.py --host linux --arch arm Change-Id: I7cd2706464093e2be058917996b2eb2bb7ce9663 - Merge "Don't default to gold for aarch64." - Explicitly use -m64. The Darwin toolchain builds 32-bit binaries by default. Might as well be explicit for all platforms. Test: ./build.py --arch arm64 --host linux Bug: None Change-Id: I350ab805441aa99f45c7166b7a27840438d6bf75 - Don't default to gold for aarch64. Test: ./build.py --arch arm64 --host linux Bug: https://issuetracker.google.com/70838247 Change-Id: I70506b9b12d2d904e109536a01276feb7582adc5 - Merge "Windows LTO: bfd: Search plugin dir for dependencies" - Fix binutils package name. Test: ./build.py --arch arm64 --host linux Bug: None Exempt-From-Owner-Approval: trivially correct Change-Id: I3339bfa694be929ad44b87d75a4cf3621b58451c - Windows LTO: bfd: Search plugin dir for dependencies We need this change to find LLVMgold.dll's libwinpthread-1.dll dependency. The same modification was already applied to the Android gold linker: https://android-review.googlesource.com/c/toolchain/binutils/+/438069. Test: toolchain/gcc/build.py --toolchain aarch64-linux-android \ --host windows64 Test: ./build.py --arch=arm --host win64 Bug: android/ndk#313 Bug: android/ndk#632 Change-Id: I0af8716bdc90e2d88954e7790a67da0d47b88c96 - gold: simpler encoding for SHT_RELR sections. This change modifies the encoding used in SHT_RELR sections to a simpler version that gives better results. This encoding was suggested by Andrew Grieve and is described in this post on generic-abi@googlegroups.com: https://groups.google.com/d/msg/generic-abi/bX460iggiKg/Pi9aSwwABgAJ Bug: None Test: 'gold --experimental-use-relr' creates PIE binaries with '.relr.dyn' sections to store relative relocations using the new encoding. Change-Id: I0dd0a7e0767210d06f29a86b97c5caded05b91e9 - Use {i686,x86_64}-w64-mingw32 triples Test: ./toolchain/binutils/build.py --arch arm --host win Test: ./toolchain/binutils/build.py --arch arm --host win64 Change-Id: I0a47faa82c9690acf2ea3e50f8bcb812fdbc6fc9 - gold, readelf: add experimental support for SHT_RELR sections. This change adds experimental support for SHT_RELR sections, proposed here: https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg SHT_RELR sections are supported for arm, aarch64, and x86_64 targets. To enable them, pass '--experimental-use-relr' flag to gold. Definitions for the new ELF section type and dynamic array tags, as well as the encoding used in the new section are all under discussion and are subject to change. Use with caution! Bug: None Test: 'gold --experimental-use-relr' creates PIE binaries with '.relr.dyn' sections to store relative relocations. Change-Id: Iefb4ef5ad95852f4964adf6c8e9b3708a9bdb5f8 - Merge "ld.bfd: omit DF_1_PIE when targeting Android" - ld.bfd: omit DF_1_PIE when targeting Android Some versions of the Android dynamic linker (e.g. N) print a warning: WARNING: linker: /data/local/tmp/a.out: unsupported flags DT_FLAGS_1=0x8000000 ${target} will be something like: - arm-unknown-linux-androideabi - aarch64-unknown-linux-android - i686-pc-linux-android Bug: android/ndk#602 Test: manual: 1. create a standalone ARM64 toolchain with NDK r16b 2. echo 'int main() {}' > justmain.c 3. ~/stand-arm64-21-libc++-r16b/bin/clang justmain.c -pie -fPIE \ -fuse-ld=bfd && \ readelf -d a.out | grep FLAG -- OUTPUT: 0x000000006ffffffb (FLAGS_1) Flags: 8000000 4. ~/stand-arm64-21-libc++-r16b/bin/clang justmain.c -pie -fPIE \ -fuse-ld=bfd \ -B ~/android/ndk/out/binutils/linux/arm64/install/binutils-arm64-linux/aarch64-linux-android/bin && \ readelf -d a.out | grep FLAG -- OUTPUT: nothing Change-Id: I040b6edbd8d7943b790db0ef19b76cfdffc1ccdf - Merge "Fix more mac build probably." - Fix more mac build probably. Test: None because mac Bug: None Change-Id: I1e91ad3df298b399f15c39708f79f02758b1689e - Merge "Fix Darwin compiler name." - Fix Darwin compiler name. Test: None because mac Bug: None Change-Id: If5844c790b0a14e8a6a88d1cd89ecbec5670e1f8 Exempt-From-Owner-Approval: build fix - Make sure binutils is stripped. 600MB of binutils per arch is a bit much. Test: file out/.../bin/aarch64-linux-android-ld.gold Bug: None Change-Id: I613dfd5f433d0a83269ef4dfcfe98a499f9ba8dc - Add a script for building just binutils. In contrast to building binutils via the GCC build, each target here takes only 1 minute instead of 10. Given that we've stopped supporting GCC, it's also nice to not have to rebuild something that shouldn't have changed anyway. This also has the advantage of building to a specific location in the out directory rather than /tmp, meaning it's easy to cd into the build directory and just run make rather than rerunning the full build script. Test: ./build.py for all architectures, linux, win, win64 Bug: None Change-Id: I067d84c5439c56004fc12de496f8f66fba7f7bf7 - gold: fix PR gold/21868 - internal error in fix_errata_and_relocate_erratum_stubs. am: 6e65e8d51c am: fbc6a65131 am: 31d16cab9d Change-Id: I32f53b7fae36af11b45ba85ce2d4a7844309fc9f - gold: don't install branch-to-stub for TLS relaxed ERRATUM 843419 sequences on AArch64 am: 1ea3c286b3 am: b3ef62be6d am: 2ec6b16a09 Change-Id: Id84ee80ab4a47428e9fcf810ab0eff3966b21ca7 - gold: fix PR gold/21868 - internal error in fix_errata_and_relocate_erratum_stubs. am: 6e65e8d51c am: fbc6a65131 Change-Id: Iebfebbb0591e65ac2489e56bab31464fd93ff83a - gold: don't install branch-to-stub for TLS relaxed ERRATUM 843419 sequences on AArch64 am: 1ea3c286b3 am: b3ef62be6d Change-Id: I513a638d857447b4e7e07c81cc9d924612d27bce - gold: fix PR gold/21868 - internal error in fix_errata_and_relocate_erratum_stubs. am: 6e65e8d51c Change-Id: Ieb1b1791ac9f4ce41b0f61416110744dce32f8f1 - gold: don't install branch-to-stub for TLS relaxed ERRATUM 843419 sequences on AArch64 am: 1ea3c286b3 Change-Id: I135094704d04ab61bd83c6bde472f8b0d549b85d - gold: fix PR gold/21868 - internal error in fix_errata_and_relocate_erratum_stubs. PR gold/21868 * aarch64.cc (AArch64_relobj::try_fix_erratum_843419_optimized): Add extra view offset argument to function. (AArch64_relobj::fix_errata_and_relocate_erratum_stubs): Add extra view offset set to the output offset when the view has is_input_output_view set, since it has not already been included. Pass this to try_fix_erratum_843419_optimized. This change is backport of commit 972d8a18db78974f59e1a6b1dc02f7e5b7d226d2 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=972d8a18db78974f59e1a6b1dc02f7e5b7d226d2 to binutils-2.27. Change-Id: Ief7dcc5743feb04d090eaac9b677abe568ca1268 - gold: don't install branch-to-stub for TLS relaxed ERRATUM 843419 sequences on AArch64 TLS relaxation may change erratum 843419 sequences that those offending ADRP instructions actually transformed into other instructions in which case there is erratum 843419 risk anymore that we should avoid installing unnecessary branch-to-stub. * aarch64.cc (Insn_utilities::is_mrs_tpidr_el0): New method. (AArch64_relobj<size, big_endian>::try_fix_erratum_843419_optimized): Return ture for some TLS relaxed sequences. This change is backport of commit 37de058ab2e9619fbb6dea52ec2773a5d65619c4 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=37de058ab2e9619fbb6dea52ec2773a5d65619c4 to binutils-2.27. Change-Id: I47a89d94ff8a0838b3d2ff9be41d9e98bfd59e85 - bfd: use a temporary variable to convert 'const char*' to 'char *'. am: 53dd00a1a3 am: 82a0970264 am: de307b61f3 Change-Id: Ic71902c761e86686d25c5a84a7f99c63a26a50d6 - bfd: use a temporary variable to convert 'const char*' to 'char *'. am: 53dd00a1a3 am: 82a0970264 Change-Id: If9b02db8cc06962b747e8293ae84eb18b7da054c - bfd: use a temporary variable to convert 'const char*' to 'char *'. am: 53dd00a1a3 Change-Id: I1a86c7d36ec3a1108dff12c24664acb1fa640d14 - bfd: use a temporary variable to convert 'const char*' to 'char *'. win_arm and win_arm64 builds are failing due to the compiler complaining that passing argument 7 of 'elf32_arm_create_stub' discards qualifiers from pointer target type. This change hopefully fixes those errors. Bug: 37683243 Test: './toolchain/gcc/build.py --host=windows' works. Change-Id: I397f876fb23e9b4a1479daffcc95e5d894b22919 - Merge "gas: explicit cast between pointer and integer of different size." am: 4017c42d6e am: cbdfd753e1 am: 7da921a376 Change-Id: Ic472a2c478b5bb4a993e9cebb4d5c1c670b4e420 - Merge "gas: explicit cast between pointer and integer of different size." am: 4017c42d6e am: cbdfd753e1 Change-Id: I4446f2dabbd397ca9afcc0425534a7c8601e4973 - Merge "gas: explicit cast between pointer and integer of different size." am: 4017c42d6e Change-Id: Ifa020fdf1f874210297abfdad3108ddc42abab98 - Merge "gas: explicit cast between pointer and integer of different size." - opcodes: initialize variable before use. am: 4abbf7de92 am: eb2c225267 am: f3e0802a9a Change-Id: I464b0381838ebeceac57c840582875434538ff01 - opcodes: initialize variable before use. am: 4abbf7de92 am: eb2c225267 Change-Id: I293537d64496a6cab7fb615c362c4c26e4f8e318 - opcodes: initialize variable before use. am: 4abbf7de92 Change-Id: I7914942674a104a9e2fdb37e4383dcbb4a537934 - opcodes: initialize variable before use. This fixes build errors due to the compiler complaining that 'imm' may be used uninitialized in function 'expand_fp_imm'. Bug: 37683243 Test: './toolchain/gcc/build.py --host=windows' works. Change-Id: I3c6b3a97255d647b3227f67f18193e9d5186a572 - gas: explicit cast between pointer and integer of different size. This fixes build errors for win_x86_64 and win_arm64 toolchains, where pointer and integer are different sizes. Bug: 37683243 Test: './toolchain/gcc/build.py --host=windows' works. Change-Id: I610707804476196e6de61587cc57385ca7a168e3 - Merge "as, ld, nm: disable sbrk() calls on Darwin." am: 3550577e2e am: f3e61642bb am: 2c7e9f6241 Change-Id: I0bb170e3a81d19b01e74fdb0681c21f47c18a221 - Merge "gold: use format macros from <inttypes.h>" am: 1ab36ab461 am: 26cd4d6ff4 am: ec636530e5 Change-Id: I862166ca84c82b16eba12ab61da3e882965a0f1c - gold: do not use extended initializer lists on Darwin. am: 697ae2a06e am: 2140ec53f3 am: 349c3035c5 Change-Id: Ic3a7422b74dfe09daeab1b44260cbd9a57d18806 - Merge "as, ld, nm: disable sbrk() calls on Darwin." am: 3550577e2e am: f3e61642bb Change-Id: I82554ba04107879d26171607c36ff918e2e6ee7b - Merge "gold: use format macros from <inttypes.h>" am: 1ab36ab461 am: 26cd4d6ff4 Change-Id: Id0a52b591f0936c5434d09488adb3adf84df0700 - gold: do not use extended initializer lists on Darwin. am: 697ae2a06e am: 2140ec53f3 Change-Id: I8f520ab13fbd6eaab719214f28bc71d4700e8616 - Merge "as, ld, nm: disable sbrk() calls on Darwin." am: 3550577e2e Change-Id: I9ab78c6276d27115c98365f7ce829f31a52c4f7e - Merge "gold: use format macros from <inttypes.h>" am: 1ab36ab461 Change-Id: I0a40e1556a4e74006b5493d178fbacf8d6f88840 - gold: do not use extended initializer lists on Darwin. am: 697ae2a06e Change-Id: I01ec4140ea331f9109e22591204aa9f9e1eb8cba - Merge "as, ld, nm: disable sbrk() calls on Darwin." - Merge "gold: use format macros from <inttypes.h>" - gold: do not use extended initializer lists on Darwin. On Darwin, PTHREAD_ONCE_INIT is {0x30B1BCBA, {0}} and GCC < 4.4 doesn't support extended initializer lists. This fixes build failures on Darwin, where the gcc/g++ version used is 4.2.1. Bug: 37683243 Test: binutils-2.27 builds successfully on Darwin. Change-Id: I8e09a8886ea8ef69c90e7ec5513fbf106d3c4606 - gold: use format macros from <inttypes.h> This fixes build failures on Darwin, where the compiler complains about using '%ld' format for uint64_t values. Bug: 37683243 Test: binutils-2.27 builds successfully on Darwin. Change-Id: I24d257e43d595e27c292986853e5ce846cc56a14 - as, ld, nm: disable sbrk() calls on Darwin. sbrk() is declared as deprecated in "/usr/include/unistd.h" on Darwin. This causes build errors when building binutils. Configure detects that sbrk() is present and defines HAVE_SBRK, but the compiler sees __deprecated attribute on the declaration and errors out. Bug: 37683243 Test: binutils-2.27 builds successfully on Darwin. Change-Id: I5baad79e19f49c5ea8f657173070382f8504dbd1 - Move OWNERS file to top level. am: e97411a56d am: 91fae7ed5d am: 9ad67ad7b3 Change-Id: I36fc39dbeb560d37d5985bb6851de23a2aa27cf2 - Move OWNERS file to top level. am: e97411a56d am: 91fae7ed5d Change-Id: Iaa57296b760a47ba2114a3ee8856845b2a3013a8 - Move OWNERS file to top level. am: e97411a56d Change-Id: I2d0d1d578cdad6a497a18e8601872e5ad3bc8221 - resolve merge conflicts of 36b7a6f6 to stage-aosp-master am: 7f335ef2f6 am: 9e59ab47b6 Change-Id: Icca3defbc2a4b6c892e6a1cbccc67f75d2180502 - Move OWNERS file to top level. The OWNERS file accidentally got moved to binutils-2.27 subdirectory during the merge of binutils-2_27-branch. Change-Id: I6e6e66d75cea608954068ccf3eb09b4018204f05 - resolve merge conflicts of 36b7a6f6 to stage-aosp-master am: 7f335ef2f6 Change-Id: If22483bf04f36ca23f93ff867f80741b7873eb6c - resolve merge conflicts of 36b7a6f6 to stage-aosp-master Test: None - Merge binutils-2_27-branch into master. After this merge, the tree on master branch is identical to the tree in binutils-2_27-branch, but moved to a binutils-2.27 sub- directory. The old binutils-2.25 subdirectory has been removed. Bug: 37683243 Test: ./ndk/checkbuild.py passed. Test: ./toolchain/gcc/build.py passed and built binutils-2.27. Change-Id: I5bacb1bff44b19845133f3344cb6ff26eb3616f6 - Improve Windows dlfcn shims. We can use GetLastError/FormatMessage to get a less useless error message from dlerror. Use LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR to search the loaded library's directory to satisfy dependencies. Test: toolchain/gcc/build.py --toolchain arm-linux-androideabi \ --host windows64 Bug: android/ndk#313 This change is forward-port of c/438069 - https://android-review.googlesource.com/#/c/438069 to binutils-2_27-branch. Change-Id: I66840280cdd7b4176a1ad02f022457bd0336d101 - Improve Windows dlfcn shims. am: e574f15757 am: 5318987751 am: 43d3408243 am: ca1203218b Change-Id: Ia2c53f2876065f936556331579cb87e705417ad5 - Improve Windows dlfcn shims. am: e574f15757 am: 5318987751 am: 43d3408243 Change-Id: Idf119a22dba08e188059e44af6a92f33202252c9 - Improve Windows dlfcn shims. am: e574f15757 am: 5318987751 Change-Id: I1208f8e67fd567a2505bf7efb5013934c7cb025d - Add OWNERS file. Change-Id: I716a9ed8376b85b6f7f850f90d213bf514a73f11 - gold: fix PR gold/21491 - errata workaround can produce broken images. The problem is caused by the fact that gold is relocating the stubs for an entire output section when it processes the relocations for a particular input section that happened to be designated as the stub table "owner". The Relocate_task for that input section may or may not run before the Relocate_task for another input section that contains the code that needs the erratum fix, but doesn't "own" the stub table. If it runs before (or might even race with) that other task, it ends up with a copy of the unrelocated original instruction. In other words - when calling fix_errata() from do_relocate_sections(), gold is going through the list of errata stubs that are associated only with that object. This routine updates the stored original instruction and replaces it in the output view with a branch to the stub. Later, as gold is going through the object file's input sections, it then checks for stub tables "owned" by each input section, and writes out all the stubs from that stub table, regardless of what object file each stub is associated with. Fixed by relocating the erratum stub only after the corresponding errata spot is fixed. That is to have fix_errata() call Stub_table::relocate_erratum_stub() for each stub. PR gold/21491 * aarch64.cc (Erratum_stub::invalidate_erratum_stub): New method. (Erratum_stub::is_invalidated_erratum_stub): New method. (Stub_table::relocate_reloc_stub): Renamed from "relocate_stub". (Stub_table::relocate_reloc_stubs): Renamed from "relocate_stubs". (Stub_table::relocate_erratum_stub): New method. (AArch64_relobj::fix_errata_and_relocate_erratum_stubs): Renamed from "fix_errata". (Target_aarch64::relocate_reloc_stub): Renamed from "relocate_stub". This change is backport of commit df2f63a6a0fc19c54e58aab8afe262baf3cb1a3c - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=df2f63a6a0fc19c54e58aab8afe262baf3cb1a3c to binutils-2_27-branch. Change-Id: I1f70f82f0330b4249589d05a86d5d9daac6e9b93 - gas: enable -mshared by default. From gas help: -mshared disable branch optimization for shared code. The default behavior is to optimize out non-PLT relocations against defined non-weak global branch targets with default visibility. This optimization has been a source of many issues during testing of new binutils: - https://bugs.chromium.org/p/chromium/issues/detail?id=738283 - https://bugs.chromium.org/p/chromium/issues/detail?id=723906 Change-Id: Id2b4970d2f73de80adaead81f43f7f88c83630cf - Make sure errata fix is done, whether or not flags are passed. am: f3d35cf659 am: aa1775f6b2 am: 98fcb1fc0b am: 33520f9b79 Change-Id: I9ad6933ad61b811c8e8ea9f102b16ab5e60bcb43 - Make sure errata fix is done, whether or not flags are passed. am: f3d35cf659 am: aa1775f6b2 am: 98fcb1fc0b Change-Id: Ibe66a75736eb0b9a40d4b7827c4888a4f29625ae - Make sure errata fix is done, whether or not flags are passed. am: f3d35cf659 am: aa1775f6b2 Change-Id: Ia14e01b0d06385166f3a4c4113dd4cc669399bbc - Merge "Merge "Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49" into stage-aosp-master am: 77b155b0b8 am: f000e4520b" into oc-dr1-dev-plus-aosp am: 314dd4ecad Change-Id: I9f236ff4ecef6275e083fac4b30cfc04875dbf40 - Merge "Merge "Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49" into stage-aosp-master am: 77b155b0b8 am: f000e4520b" into oc-dr1-dev-plus-aosp am: e5b56a867f Change-Id: Ic3d8340e5c8f1716a6d1a924163d2b01c4e9fbff - Merge "Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49 am: 8bb04269d7 am: 4a2e95641b" into oc-dr1-dev-plus-aosp am: 0149f698a6 Change-Id: I2ef14fbec115159da4ea5c01d2e405ae33fe42da - Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49 am: 8bb04269d7 am: 4a2e95641b am: bebc85fc50 Change-Id: I090ddb7495a8d35ecdab4e892435db9cc39d1c9c - Merge "Merge "Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49" into stage-aosp-master am: 77b155b0b8 am: f000e4520b" into oc-dr1-dev-plus-aosp - Merge "Merge "Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49" into stage-aosp-master am: 77b155b0b8 am: f000e4520b" into oc-dr1-dev-plus-aosp - Merge "Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49" into stage-aosp-master am: 77b155b0b8 am: f000e4520b Change-Id: Id80a28a8790e08c5584839c4b6e44b9de64c983c - Merge "Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49" into stage-aosp-master am: 77b155b0b8 am: f000e4520b Change-Id: I17a3c2e66d2a49fb09f936c2ca283e760749598b - Merge "Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49 am: 8bb04269d7 am: 4a2e95641b" into oc-dr1-dev-plus-aosp - Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49 am: 8bb04269d7 am: 4a2e95641b Change-Id: I69b3ffa5ce0b79482c2fa485bf10fdb945bb9faf - Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49 am: 8bb04269d7 am: 4a2e95641b Change-Id: I3fbd665159cd936e75017fb704f53f3aa4c8dd1e - Merge "Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49" into stage-aosp-master am: 77b155b0b8 Change-Id: I8e2422c9f2b7897e806daf27a5f46243c5b01cbd - Add rest of toolchain team to OWNERS file. am: 3fb3ed2e49 am: 8bb04269d7 Change-Id: Ic147d95eb1db75302e65b2d40176d4d0b98053b5 - Merge "Merge "Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574" into stage-aosp-master am: 2062d0dfc8 am: 1aa199f9ed" into oc-dr1-dev-plus-aosp am: d8a8c2bb3a Change-Id: Id86a21f4233bc27b29beb4876b3d9c4f2e4a1144 - Merge "Merge "Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574" into stage-aosp-master am: 2062d0dfc8 am: 1aa199f9ed" into oc-dr1-dev-plus-aosp am: a818858f82 Change-Id: I7f5ad827f3ccd10d0882cf845ad6cabcdd3afe64 - Merge "Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574 am: 6ae1b21657 am: 18bcd8df3f" into oc-dr1-dev-plus-aosp am: 3e94cbac1e Change-Id: I9f586e155bcae9d27d41eb4d01111fd4efcc2995 - Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574 am: 6ae1b21657 am: 18bcd8df3f am: 1ce80156f9 Change-Id: If563f8416e4e7c57825889ff8fc6b003ced39655 - Merge "Merge "Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574" into stage-aosp-master am: 2062d0dfc8 am: 1aa199f9ed" into oc-dr1-dev-plus-aosp - Merge "Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574" into stage-aosp-master am: 2062d0dfc8 am: 1aa199f9ed Change-Id: I111d52339888c84a9ee219bdd7e8b4193fce527c - Merge "Merge "Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574" into stage-aosp-master am: 2062d0dfc8 am: 1aa199f9ed" into oc-dr1-dev-plus-aosp - Merge "Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574 am: 6ae1b21657 am: 18bcd8df3f" into oc-dr1-dev-plus-aosp - Merge "Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574" into stage-aosp-master am: 2062d0dfc8 am: 1aa199f9ed Change-Id: I9d03be7a330cb89d8e0abeb33b337dfc36a4f565 - Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574 am: 6ae1b21657 am: 18bcd8df3f Change-Id: I9df99fe8c722654db37136b1a7bc0d92471b3f0c - Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574 am: 6ae1b21657 am: 18bcd8df3f Change-Id: I29d7c37809fe4c3312c81c97187747b06f3065a5 - Merge "Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574" into stage-aosp-master am: 2062d0dfc8 Change-Id: I3a7f9cf0c38527ae1b158c0aa735a07a0ffefdf1 - Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574 am: 6ae1b21657 Change-Id: Iec49e785302e984ee3592fa276deb4a7a5f52b19 - Merge "Merge "Apply upstream binutils patch to fix LTO issue with gold." am: ea6b4aa0f2" into stage-aosp-master am: c4a46d96de am: 866219a039 am: 3054b44a23 Change-Id: I5fa2ed47819b2ad5d753d61784067c9fd83d39ae - Merge "Apply upstream binutils patch to fix LTO issue with gold." am: ea6b4aa0f2 am: 8f49b83734 am: 9940a0057e am: b9df147b61 Change-Id: I51b599096c79a3e5d6b9f304f47aa2f52c572823 - Add Luis and Caroline to the OWNERS file. am: 9b20d56a93 am: f21890e8da am: 1753ebf7cf am: f4e528afc8 Change-Id: I98c0593c1a65dacc487b29659d9d455bca046a8f - Merge "Merge "Apply upstream binutils patch to fix LTO issue with gold." am: ea6b4aa0f2" into stage-aosp-master am: c4a46d96de am: 866219a039 Change-Id: Ieda39dd1d1e46338fa70cd6be83eb666b7ba01f5 - Merge "Apply upstream binutils patch to fix LTO issue with gold." am: ea6b4aa0f2 am: 8f49b83734 am: 9940a0057e Change-Id: I5422467d419e294850cb60cce9035992133b08c1 - Add Luis and Caroline to the OWNERS file. am: 9b20d56a93 am: f21890e8da am: 1753ebf7cf Change-Id: I4f425ecd79ce4baeedf698343aac7f8036109d0f - Merge "Merge "Apply upstream binutils patch to fix LTO issue with gold." am: ea6b4aa0f2" into stage-aosp-master am: c4a46d96de Change-Id: If0052b482e3d8c56eda738a9a090acf4870f2b00 - Merge "Apply upstream binutils patch to fix LTO issue with gold." am: ea6b4aa0f2 am: 8f49b83734 Change-Id: I036ac38f98d056a53d9c09a51fee50d1d5e95aa3 - Add Luis and Caroline to the OWNERS file. am: 9b20d56a93 am: f21890e8da Change-Id: Idf5b797ca8a04f7962cb225dfcd8472e8d2d5b59 - Add OWNERS in toolchain/binutils am: 1661a29f47 am: 79c2159ff0 am: d10b2d2c7d am: 1f5920befa Change-Id: Ia0ccd25ef07a66a6898f0b36327f7aa76e926334 - Add OWNERS in toolchain/binutils am: 1661a29f47 am: 79c2159ff0 am: d10b2d2c7d Change-Id: Iabbf68467536ac22aa2d10ee0754b252c30ae321 - [GAS/ARM] Fix expansion of ldr pseudo instruction The LDR rX, =cst pseudo-instruction suffers from two issues for loading integer constants in Thumb mode: - movs is used if the constant and register can be encoded using that instruction which leads to unexpected behavior due to its flag-setting behavior - mov.w, movw and mvn are used for r13 (sp) and r15 (pc) but these encoding are marked as UNPREDICTABLE This patch fixes those issues and update testing accordingly. 2017-04-24 Thomas Preud'homme <thomas.preudhomme@arm.com> gas/ * config/tc-arm.c (move_or_literal_pool): Remove code generating MOVS. Forbid MOV.W and MOVW if destination is SP or PC. * testsuite/gas/arm/thumb2_ldr_immediate_highregs_armv6t2.s: Explain expectation of LDR not generating a MOVS for low registers and small constants. Add tests of MOVW generation. * testsuite/gas/arm/thumb2_ldr_immediate_highregs_armv6t2.d: Update expected disassembly. (cherry picked from commit 534455547021f3262fa60d32cabb626af01692a3) - ld: revert two upstream commits related to interpretation of ".". This change reverts commits d2667025dd30611514810c28bee9709e4623012a and 975f8a9e3144e4d3d3f391e907c8bf94b23dc8b6 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=d2667025dd30611514810c28bee9709e4623012a - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=975f8a9e3144e4d3d3f391e907c8bf94b23dc8b6 from binutils-2_27-branch. Commit d2667025dd30611514810c28bee9709e4623012a (dated 2012-06-15) changed the interpretation of "." when it appears in an assignment statement outside of an output section statement. This change interacts with the linux kernel 3.8.* builds for amd64 and results in an unbootable kernel. This issue was introduced in binutils 2.23, and we have locally reverted this change on every upgrade since then. Commit 975f8a9e3144e4d3d3f391e907c8bf94b23dc8b6 (dated 2015-09-18) is a followup to d2667025dd30611514810c28bee9709e4623012a. It fixes pr/18963, which was caused by the first commit, by delaying some of the symbol value computations. - https://sourceware.org/bugzilla/show_bug.cgi?id=18963 Change-Id: I1eb6177d79206c8b321ccf0ee0c1e293fc94093b - gas: fix the generation of alignment frags in code sections for AArch64. PR gas/20364 * config/tc-aarch64.c (s_ltorg): Change the mapping state after aligning the frag. (aarch64_init): Treat rs_align frags in code sections as containing code, not data. * testsuite/gas/aarch64/pr20364.s: New test. * testsuite/gas/aarch64/pr20364.d: New test driver. This change is backport of commit 7ea12e5c3ad54da440c08f32da09534e63e515ca - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=7ea12e5c3ad54da440c08f32da09534e63e515ca to binutils-2_27-branch. Change-Id: I2635ae5a76de59a1a7f15b3319c4ad11f8e1c171 - gas: refine .cfi_sections check to only consider compact eh_frame. The .cfi_sections directive can be safely used multiple times with different sections named at any time unless the compact form of exception handling is requested after CFI information has been emitted. Only the compact form of CFI information changes the way in which CFI is generated and therefore cannot be retrospectively requested after generating CFI information. PR gas/20648 * dw2gencfi.c (dot_cfi_sections): Refine the check for inconsistent .cfi_sections to only consider compact vs non compact forms. * testsuite/gas/cfi/cfi-common-9.d: New file. * testsuite/gas/cfi/cfi-common-9.s: New file. * testsuite/gas/cfi/cfi.exp: Run new test. This change is backport of commit 3d3424e9a8d6ad56160b98bf6e223c0346164468 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=3d3424e9a8d6ad56160b98bf6e223c0346164468 to binutils-2_27-branch. Change-Id: I9540e21d876ef60899f5bda8023f80683e3ab94f - Fix bug where -u option with empty archive results in internal error. am: c808115817 am: 486ca67cc8 am: 19948f357a am: a9551f5dfc Change-Id: I94742aa9e974f557f726ddb4d2ac45cccd142d0c - gold: fix bug where -u option with empty archive results in internal error. PR gold/20693 * gold.cc (queue_middle_tasks): Force valid target earlier. This change is backport of commit c13b08dbbcf752480a7621aa1f89bc5440c74c25 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=c13b08dbbcf752480a7621aa1f89bc5440c74c25 to binutils-2_27-branch. Change-Id: I206f9c35ebc153cebd74e962382d8563936dfbcb - gold: improved support for --icf=safe when used with -pie. * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers): Return true even when building pie binaries. (Target_x86_64::possible_function_pointer_reloc): Check opcode for R_X86_64_PC32 relocations. (Target_x86_64::local_reloc_may_be_function_pointer): Pass extra arguments to local_reloc_may_be_function_pointer. (Target_x86_64::global_reloc_may_be_function_pointer): Likewise. * gc.h (gc_process_relocs): Add check for STT_FUNC. * testsuite/Makefile.am (icf_safe_pie_test): New test case. * testsuite/Makefile.in: Regenerate. * testsuite/icf_safe_pie_test.sh: New shell script. * testsuite/icf_safe_so_test.sh: Use "set -e". * testsuite/icf_safe_test.sh: Likewise. * testsuite/icf_test.sh: Likewise. This change is backport of commits 4aebb6312eb5dcd12f2f8420028547584b708907 and 741bcbe94d7811caa1efa500dacd047c428cce61 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=4aebb6312eb5dcd12f2f8420028547584b708907 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=741bcbe94d7811caa1efa500dacd047c428cce61 to binutils-2_27-branch. Change-Id: I605cd24cadc781bc481807efd99a096657662310 - gold: make icf respect section alignment requirements. Fix PR 17704. This fix keeps the section with the highest alignment when folding sections with ICF. PR gold/17704 * icf.cc (match_sections): Add new parameter section_addraligns. Check section alignment and keep the section with the strictest alignment. (find_identical_sections): New local variable section_addraligns. Store each section's alignment. * testsuite/pr17704a_test.s: New file. * testsuite/Makefile.am (pr17704a_test): New test. * testsuite/Makefile.in: Regenerate. This change is backport of commit ac423761af22f7858a1413cda5df3e1d5e88d4e4 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ac423761af22f7858a1413cda5df3e1d5e88d4e4 to binutils-2_27-branch. Change-Id: Ifef78a2c27e3ed70b9649b1bc44f7871eac07d66 - ld: set CodeView pdb path/name to base name. The CodeView pdb path/name field is empty leading windows minidumps to have empty module paths for the binary. This patch sets the path to the base name of the binary. This change is forward-port of c/314988 - https://android-review.googlesource.com/#/c/314988 to binutils-2_27-branch. Change-Id: Ic903fbcd360860e644893b8b22e0fa50f2022415 - gold: exit without segfault if the binary is not built with debug fission. This change is forward-port of c/230470 - https://android-review.googlesource.com/#/c/230470 to binutils-2_27-branch. Change-Id: Ic06ad39f56ca16e1eec9123f29daab4d63df2ed2 - gold: make --no-apply-dynamic-relocs the default. This change is forward-port of c/196731 - https://android-review.googlesource.com/#/c/196731 to binutils-2_27-branch. The rest of the patch was commited to master branch as 0eccf19f96d6218dd7c2f8d13f0546c2b942cc08 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=0eccf19f96d6218dd7c2f8d13f0546c2b942cc08 and is already included in binutils-2_27-branch. Change-Id: I081b48bf1535ea227c0c3fb01ce8e417c8ded0e4 - gold: add description to warning about unsafe data segment size for PIE. This change is forward-port of c/195802 - https://android-review.googlesource.com/#/c/195802 to binutils-2_27-branch. Change-Id: I568b5fe1105ad0955166b5d8929dc07a1a327c73 - gas: silence ARM as error "MOV Rd, Rs" two low regs with clang/armv5/thumb1. This change is forward-port of commit b33d0ddc123435be5e60ebb15a37b3bfb651dc7e - https://android.googlesource.com/toolchain/binutils/+/b33d0ddc123435be5e60ebb15a37b3bfb651dc7e to binutils-2_27-branch. For more details, see commit message for 92337cf27b1497415e3f345ea9292e96ced2a8fa - https://android.googlesource.com/toolchain/binutils/+/92337cf27b1497415e3f345ea9292e96ced2a8fa Change-Id: I78d77dce19710b86b6de0201082cac50fa70d59f - bfd: do not assert if tag_FP_arch does not exist. This change is forward-port of commit 1000fadfaa979b623e1fbd0c87858be4f5b6dffd - https://android.googlesource.com/toolchain/binutils/+/1000fadfaa979b623e1fbd0c87858be4f5b6dffd to binutils-2_27-branch. Change-Id: I9937bc22d4de2ebdd79eb3f52a4137c7b89abacb - gold: add 'smart padding' support for stub table (arm). This change adds support for 'smart padding' (default ON) for stub table, which reduces up to 50% of relaxation time on large objects. This change is forward-port of c/275313 - https://chromium-review.googlesource.com/#/c/275313 to binutils-2_27-branch. Change-Id: I76017cc50f1c456817031fbc87d8c49edbc7d70c - gold/ld: add support for poisoned system directories. This is based on the old CodeSourcery patch written by Joseph Myers to add support to the link for detecting & rejecting bad -L paths when using a cross-compiler. The differences here: * The command line flags are always available. * We can turn on & off the warning via the command line. * The configure option controls the default warning behavior. * Add support for gold. This change is forward-port of c/272083 and c/272716 - https://chromium-review.googlesource.com/#/c/272083 - https://chromium-review.googlesource.com/#/c/272716 to binutils-2_27-branch. Change-Id: I55600382e41d4987ecdb3c9d6a6eaf969ecac37c - gas: enable .incbin directive by default. This change is forward-port of c/273909 - https://chromium-review.googlesource.com/#/c/273909 to binutils-2_27-branch. Change-Id: Id9e9d3f39c49c28b0216e1e5026912b8c4dc47e2 - gold: account for GOT and DYNAMIC sections when estimating data segment size. This change is forward-port of google cl/95766599, cl/97694136, and cl/122164147 to binutils-2_27-branch. Change-Id: I21698aeec4a67d16b90e8707d78d04e688f37a42 - gold: disable PIE if data segment size is more than the safe value. This change is forward-port of google cl/93067133 to binutils-2_27-branch. Change-Id: I6ed96f1ea013b77d8ff7b5cb799552c7a6c0ecbf - gold: warn if data segment size is more than the safe value with PIE links. This change is forward-port of google cl/91421998 and cl/91423363 to binutils-2_27-branch. Change-Id: Iacb625fb1b58b06292bdc0ffa520ecc165afc9cf - gold: fix debug output to print correct context. This change is forward-port of commit ac2a5ee857c267a3003c9db3e1a3219f1c6f122d - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ac2a5ee857c267a3003c9db3e1a3219f1c6f122d from upstream branch users/ccoutant/two-level-line-150331 - https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/users/ccoutant/two-level-line-150331 to binutils-2_27-branch. The rest of the patch was commited to master branch as 437ddf0c4cb63fdb68c4bd1cc155144db344d0c5 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=437ddf0c4cb63fdb68c4bd1cc155144db344d0c5 and is already included in binutils-2_27-branch. Change-Id: Icbe2e8eb911f77d14e7e95bc307bafab6f4d564e - gold: add support for two-level line tables. This change is forward-port of commit 2cd0390339e0f7b5cd6353f1f86aa6ceb0fb3536 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=2cd0390339e0f7b5cd6353f1f86aa6ceb0fb3536 from upstream branch users/ccoutant/two-level-line-150331 - https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/users/ccoutant/two-level-line-150331 to binutils-2_27-branch. Change-Id: I3315121377bdfa9b1e7a75efa87d4098db4b1f4a - readelf: add support for DWARF-5 and experimental two-level line number tables. This change is forward-port of commit d80608344a0908445af29b6db5266394c0376076 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=d80608344a0908445af29b6db5266394c0376076 from upstream branch users/ccoutant/two-level-line-150331 - https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/users/ccoutant/two-level-line-150331 to binutils-2_27-branch. Change-Id: Ia3e680ceb384e8ce8aed4d5aee72de48e415fefd - gas: add support for DWARF-5 and experimental two-level line number tables. This change is forward-port of commit a7c7bcafd2add7ecf8ea2ad7d3d77cf38d46c195 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=a7c7bcafd2add7ecf8ea2ad7d3d77cf38d46c195 from upstream branch users/ccoutant/two-level-line-150331 - https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/users/ccoutant/two-level-line-150331 to binutils-2_27-branch. Change-Id: I070d675b2403325fe3087be71b158ff765a8aab1 - dwarf: add experimental DWARF-5 values for two-level line number tables. This change is forward-port of commit 13a142ce0959837746e61063b6b18ac70344a474 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=13a142ce0959837746e61063b6b18ac70344a474 from upstream branch users/ccoutant/two-level-line-150331 - https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/users/ccoutant/two-level-line-150331 to binutils-2_27-branch. Change-Id: I6086897f3482d3082b9eaf54d9e440a06e9e20ba - gold: map input section name prefixes. Map input section name prefixes "_function_patch_prologue." and "_function_patch_epilogue." to output section names "_function_patch_prologue" and "_function_patch_epilogue". The compiler patch that creates these sections: - http://gcc.gnu.org/ml/gcc-patches/2013-04/msg01835.html This change is forward-port of google cl/80649796 to binutils-2_27-branch. Change-Id: I9a887cf06d8e0fa9eec413b22c39750e0a5fbd86 - gas: disable .incbin, unless explicitly enabled with --allow-incbin. This change is forward-port of google cl/80426738 and cl/80451836 to binutils-2_27-branch. Change-Id: I8447d13c4c46ebd807162d60f251e6bd4890f5b9 - Update date in version.in All changes on binutils-2_27-branch in the upstream binutils repository up to and including 2017-03-15 have been imported. - https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/binutils-2_27-branch Change-Id: I1273ab3ccf8c74029a2e372ed1ee33a530499f5d - Import binutils-2_27 from upstream. This CL imports the current tip of binutils-2_27-branch from upstream binutils repository (https://sourceware.org/git/binutils-gdb.git). It does not import the full history from upstream. Instead, the top level binutils-2.25/ directory in this repository was deleted, and the contents of the tree from the upstream repository were copied here at top level (no binutils-2.27/ subdirectory). The origin commit used for the copy is b5d3ac25628b1a16409a9816623c34a45377d400 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=b5d3ac25628b1a16409a9816623c34a45377d400 on binutils-2_27-branch - https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/binutils-2_27-branch After the initial copy, these four top-level directories were expunged: gdb, sim, readline, and libdecnumber. These are extra components in the upstream binutils repository that we do not build or need. Change-Id: I61be5898baf69579ff9e57f0d0bd177d4d048ad0
I.e. #137 has not been fixed in the Windows x64 build of the NDK - I still get
ndk-bundle\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\aarch64-linux-android\bin\ld.gold.exe
Error:error: <some_source_file>.cpp.o:1:3: invalid character
The text was updated successfully, but these errors were encountered: