Parameters--whole-archive and--no-whole-archive in GCC and LD

Source: Internet
Author: User
Parameters--whole-archive and--no-whole-archive in GCC and LD

First--whole-archive and--no-whole-archive are LD proprietary command-line parameters, GCC does not know, to pass through the GCC to LD, need to precede them with-WL, string.

--whole-archive can output the functions and variables contained in the static library that appear behind it to the dynamic library, and--no-whole-archive turns off this feature.

For example, you should write the LIBA.A libb.a libc.a output to Libabc.dll (or libabc.so):

LIBABC.DLL:LIBA.C LIBB.A LIBC.A

Gcc-shared-o [email protected]-L-WL,--whole-archive-la-lb-lc-wl,--no-whole-archive

There cannot be a function with the same name in the library under the--whole-archive function.

Parameters--whole-archive and--no-whole-archive in GCC and LD

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.