This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Linking dependencies into static library / Partial linking


Hi Philip,

In the end, I would really like to have a libhebe.a file that only exports the symbols of the wrapper AND does not contain unresolved / undefined symbols that impose linker dependencies. Is this at all possible?

What you want is partial linking. See the description of the --relocatable linker command line switch in the linker manual. Couple that with whole archive linking and you should get the result you want. ie something like this will probably work:


  % gcc *.cc wrapper.o -Wl,--whole-archive -lglpk -Wl,--no-whole-archive
    -Wl,--relocatable -o hebe.o

Cheers
  Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]