GCC options-xlinker and-WL differences

Source: Internet
Author: User

Write down to their own memo, in the process of using GCC found that the original passed to the linker LD can use both Xlinker and WL two commands, both of these commands can be correctly passed to the LD as the use, now summarizes the difference between the two.

Xlinker The argument followed by the first is a space, and the first character followed by the WL is ",".

For the pass "-assert definitions" command to LD, Xlinker to pass two parameters at a time to write two times "Xlinker", such as-xlinker-assert-xlinker Defintions instead of-xlinker "-assert definitions" because the linker would consider this to be a parameter, not two parameters. If you're using GNU linker at this point, it's usually easier to use option=value, like-xlinker-map-xlinker Output.mp can be abbreviated as-XLINKER-MAP=OUTPUT.MAP. And for the Wl, because his parameter segmentation is to use "," so you can not write as many as xlinker, just need to write a number of commas can, take this example, can be written-wl,-map, Output.map of course, if you use the GNU linker you can also-wl,-map=output.map.

So for rpath to use Xlinker can be written-xlinker-rpath-xlinker <dir> (-xlinker-rpath=<dir>), for the Wl can be written-wl,rpath,< Dir> (-wl,rpath=<dir>).

GCC options-xlinker and-WL differences

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.