diff mbox series

[2/3] x86: Enable -fdata-sections always

Message ID 20180820123220.55342-3-agraf@suse.de
State Accepted
Commit 1acbd0ea99e7ebd98a78ffcce4ee174f943cab26
Headers show
Series efi_loader: Fix -fdata-section fallout with bss | expand

Commit Message

Alexander Graf Aug. 20, 2018, 12:32 p.m. UTC
We left -fdata-sections disabled for x86_64 before because we encountered
random bugs that were at that time inexplicable.

Turns out this really was just side effects of missing .bss* statements
in the linker scripts. With those fixed, we can enable data sections for all
targets.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/x86/config.mk | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Bin Meng Aug. 21, 2018, 8:34 a.m. UTC | #1
On Mon, Aug 20, 2018 at 8:32 PM, Alexander Graf <agraf@suse.de> wrote:
> We left -fdata-sections disabled for x86_64 before because we encountered
> random bugs that were at that time inexplicable.
>
> Turns out this really was just side effects of missing .bss* statements
> in the linker scripts. With those fixed, we can enable data sections for all
> targets.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  arch/x86/config.mk | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
diff mbox series

Patch

diff --git a/arch/x86/config.mk b/arch/x86/config.mk
index 586e11a0dd..5b04febd68 100644
--- a/arch/x86/config.mk
+++ b/arch/x86/config.mk
@@ -23,13 +23,11 @@  endif
 
 ifeq ($(IS_32BIT),y)
 PLATFORM_CPPFLAGS += -march=i386 -m32
-# TODO: These break on x86_64; need to debug further
-PLATFORM_RELFLAGS += -fdata-sections
 else
 PLATFORM_CPPFLAGS += $(if $(CONFIG_SPL_BUILD),,-fpic) -fno-common -m64
 endif
 
-PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden
+PLATFORM_RELFLAGS += -fdata-sections -ffunction-sections -fvisibility=hidden
 
 PLATFORM_LDFLAGS += -Bsymbolic -Bsymbolic-functions
 PLATFORM_LDFLAGS += -m $(if $(IS_32BIT),elf_i386,elf_x86_64)