Skip to content

Commit 338d6de

Browse files
committedDec 22, 2015
Fix ARM __cxa_end_cleanup() and gc-sections.
This commit adds SHF_ALLOC and SHF_EXECINSTR section flags to `.text.__cxa_end_cleanup` section. This fixes a link error when we are using integrated-as and `ld.gold` (with `-Wl,--gc-sections` and `-Wl,--fatal-warnings`.) Detailed Explanation: 1. There might be some problem with LLVM integrated-as. It is not emitting any section flags for text sections. (This will be fixed in an independent commit.) 2. `ld.gold` will skip the external symbols in the section without SHF_ALLOC. This is the reason why `.text.__cxa_end_cleanup_impl` section is discarded even though it is referenced by `__cxa_end_cleanup()`. This commit workaround the problem by specifying the section flags explicitly. Fix http://llvm.org/PR21292 llvm-svn: 256241
1 parent 5176f7e commit 338d6de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎libcxxabi/src/cxa_exception.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ __cxa_end_cleanup_impl()
334334
}
335335

336336
asm (
337-
" .pushsection .text.__cxa_end_cleanup\n"
337+
" .pushsection .text.__cxa_end_cleanup,\"ax\",%progbits\n"
338338
" .globl __cxa_end_cleanup\n"
339339
" .type __cxa_end_cleanup,%function\n"
340340
"__cxa_end_cleanup:\n"

0 commit comments

Comments
 (0)
Please sign in to comment.