Closure

The linker lists all the required objects under the closure section with the following details:

The listing below shows a sample closure section.

Listing 1. Sample closure section
1] reset (func,global) found in reset.o
 2] __reset (func,global) found in 8568mds_init.o 
  3] __start (func,global) found in Runtime.PPCEABI.E2.UC.a __start.o
   4] __init_registers (func,weak) found in Runtime.PPCEABI.E2.UC.a __start.o
    5] _stack_addr found as linker generated symbol
    5] _SDA2_BASE_ found as linker generated symbol
    5] _SDA_BASE_ found as linker generated symbol
   4] __init_hardware (func,global) found in __ppc_eabi_init.o 
    5] usr_init (func,global) found in 8568mds_init.o 
     6] gInterruptVectorTable (notype,global) found in eppc_exception.o 
      7] gInterruptVectorTableEnd (notype,global) found in eppc_exception.o 
      7] .intvec (section,local) found in eppc_exception.o 
       8] InterruptHandler (func,global) found in interrupt.o 
        9] @21 (object,local) found in interrupt.o 
        9] printf (func,global) found in MSL_C.PPCEABI.bare.E2.UC.a printf.o
         9] __msl_count_trailing_zero64 (func,weak) found in MSL_C.PPCEABI.bare.E.a 
math_double.o
        9] >>> UNREFERENCED DUPLICATE __msl_count_trailing_zero64
        9] >>> (func,weak) found in MSL_C.PPCEABI.bare.E.a math_float.o
        9] >>> (func,weak) found in MSL_C.PPCEABI.bare.E.a math_longdouble.o

         9] >>> (func,weak) found in MSL_C.PPCEABI.bare.E.a math_ppc.o

In the sample above:

Weak symbols are allowed by the ABI and are global. They can have the same name as another symbol. The line before the UNREFERENCED DUPLICATE lists the first weak symbol found by the linker, that appears in the executable.

The line after the UNREFERENCED DUPLICATE lists other versions of a same object found by the linker. Linker will not copy the duplicate objects to the executable.