Skip to content
Advertisement

Linker –whole-archive option

I am using C language.

I am linking static libraries with --whole-archive. Linker is arm-none-eabi-ld

For example, giving the following option to the linker:

JavaScript

But still I get linking error:

JavaScript

Why is the linking error happening?

EDIT:

Full command with output:

JavaScript

Out put of:

readelf -Ws kunit.a hal.a fs.a | egrep ' (mmu_init|exec_array|mmu_pagetable|_enter_kernel)'

is:

JavaScript

Advertisement

Answer

Why is the linking error happening?

Because the symbols that you are missing: mmu_init, mmu_pagetable, etc. are in fact not defined in the libraries you expected them to be defined in.

That’s what UND in readelf output means.

Now, in order to tell you why these symbols are not defined, we’d need to know the origin of the libraries you expected them to be defined in, how these libraries were built, and possibly a lot of other details. Please ask a separate question with all the details that you can think of.

Advertisement