ELF: Try to create last thunk section at ThunkSectionSpacing bytes before the end.
Now that we have the ability to create short thunks, it is beneficial for thunk sections to be surrounded by ThunkSectionSpacing bytes of code on both sides in order to increase the likelihood that the distance from the thunk to the target will be sufficiently small to allow for the creation of a short thunk. This is currently the case for most thunks that we create, except for the last one, which could, depending on the size of the output section, potentially appear near the end and therefore have a relatively small amount of code after it. This patch moves the last thunk section to ThunkSectionSpacing bytes before the end of the output section, as long as the section is larger than 2*ThunkSectionSpacing bytes. It reduces the size of Chromium for Android's .text section by 32KB. Differential Revision: https://reviews.llvm.org/D44966 llvm-svn: 328889
Loading
Please sign in to comment