On 2018-04-27 11:36, Ralf Ramsauer wrote:
> This won't drop symbols that are marked as used.
> 
> The static, relocateable inmate library lib.a is created by ar. When
> linking executables, unreferenced symbols may be dropped, even if they
> are attributed as used.
> 
> --whole-archive ensures that those symbols will be linked.
> 
> Whereas on x86, we need --gc-sections.

That's something I do not understand yet: With [1] we will build the
whole hypervisor, including x86, with --whole-archive, and that works
fine on x86 as well.

Jan

[1]
https://www.mail-archive.com/[email protected]/msg04816.html

> 
> Signed-off-by: Ralf Ramsauer <[email protected]>
> ---
>  inmates/Makefile | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/inmates/Makefile b/inmates/Makefile
> index 595338d5..a8bcf7aa 100644
> --- a/inmates/Makefile
> +++ b/inmates/Makefile
> @@ -21,6 +21,9 @@ INCLUDES := -I$(INMATES_LIB) \
>  
>  ifeq ($(subst arm64,arm,$(SRCARCH)),arm)
>  INCLUDES += -I$(src)/../hypervisor/arch/arm-common/include
> +LDFLAGS += --whole-archive
> +else
> +LDFLAGS += --gc-sections
>  endif
>  
>  LINUXINCLUDE  := $(INCLUDES)
> @@ -34,7 +37,7 @@ KBUILD_CFLAGS += -include $(INC_CONFIG_H)
>  endif
>  
>  OBJCOPYFLAGS := -O binary
> -LDFLAGS += --gc-sections -T
> +LDFLAGS += -T
>  
>  subdir-y := lib/$(SRCARCH) demos/$(SRCARCH) tests/$(SRCARCH) tools/$(SRCARCH)
>  
> 

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to