MIPS: properly stop .eh_frame generation
Commit866b6a89c6
("MIPS: Add DWARF unwinding to assembly") added -fno-asynchronous-unwind-tables to KBUILD_CFLAGS to prevent compiler from emitting .eh_frame symbols. However, as MIPS heavily uses CFI, that's not enough. Use the approach taken for x86 (as it also uses CFI) and explicitly put CFI symbols into the .debug_frame section (except for VDSO). This allows us to drop .eh_frame from DISCARDS as it's no longer being generated. Fixes:866b6a89c6
("MIPS: Add DWARF unwinding to assembly") Suggested-by: Kees Cook <keescook@chromium.org> Signed-off-by: Alexander Lobakin <alobakin@pm.me> Reviewed-by: Kees Cook <keescook@chromium.org> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
This commit is contained in:
parent
5629d41838
commit
894ef53001
@ -20,10 +20,27 @@
|
|||||||
#include <asm/sgidefs.h>
|
#include <asm/sgidefs.h>
|
||||||
#include <asm/asm-eva.h>
|
#include <asm/asm-eva.h>
|
||||||
|
|
||||||
|
#ifndef __VDSO__
|
||||||
|
/*
|
||||||
|
* Emit CFI data in .debug_frame sections, not .eh_frame sections.
|
||||||
|
* We don't do DWARF unwinding at runtime, so only the offline DWARF
|
||||||
|
* information is useful to anyone. Note we should change this if we
|
||||||
|
* ever decide to enable DWARF unwinding at runtime.
|
||||||
|
*/
|
||||||
|
#define CFI_SECTIONS .cfi_sections .debug_frame
|
||||||
|
#else
|
||||||
|
/*
|
||||||
|
* For the vDSO, emit both runtime unwind information and debug
|
||||||
|
* symbols for the .dbg file.
|
||||||
|
*/
|
||||||
|
#define CFI_SECTIONS
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* LEAF - declare leaf routine
|
* LEAF - declare leaf routine
|
||||||
*/
|
*/
|
||||||
#define LEAF(symbol) \
|
#define LEAF(symbol) \
|
||||||
|
CFI_SECTIONS; \
|
||||||
.globl symbol; \
|
.globl symbol; \
|
||||||
.align 2; \
|
.align 2; \
|
||||||
.type symbol, @function; \
|
.type symbol, @function; \
|
||||||
@ -36,6 +53,7 @@ symbol: .frame sp, 0, ra; \
|
|||||||
* NESTED - declare nested routine entry point
|
* NESTED - declare nested routine entry point
|
||||||
*/
|
*/
|
||||||
#define NESTED(symbol, framesize, rpc) \
|
#define NESTED(symbol, framesize, rpc) \
|
||||||
|
CFI_SECTIONS; \
|
||||||
.globl symbol; \
|
.globl symbol; \
|
||||||
.align 2; \
|
.align 2; \
|
||||||
.type symbol, @function; \
|
.type symbol, @function; \
|
||||||
|
@ -224,6 +224,5 @@ SECTIONS
|
|||||||
*(.options)
|
*(.options)
|
||||||
*(.pdr)
|
*(.pdr)
|
||||||
*(.reginfo)
|
*(.reginfo)
|
||||||
*(.eh_frame)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user