Options Specific To I386 Pe Targets - Red Hat ENTERPRISE LINUX 3 - USING ID Using Instructions

Using ld, the gnu linker
Hide thumbs Also See for ENTERPRISE LINUX 3 - USING ID:
Table of Contents

Advertisement

Chapter 3. Invocation
-warn-once
Only warn once for each undefined symbol, rather than once per module which refers to it.
-warn-section-align
Warn if the address of an output section is changed because of alignment. Typically, the alignment
will be set by an input section. The address will only be changed if it not explicitly specified; that
is, if the
SECTIONS
4.6 SECTIONS Command).
-whole-archive
For each archive mentioned on the command line after the
every object file in the archive in the link, rather than searching the archive for the required object
files. This is normally used to turn an archive file into a shared library, forcing every object to be
included in the resulting shared library. This option may be used more than once.
Two notes when using this option from gcc: First, gcc doesn't know about this option, so you
have to use
-Wl,-whole-archive
after your list of archives, because gcc will add its own list of archives to your link and you may
not want this flag to affect those as well.
-wrap
symbol
Use a wrapper function for
__wrap_
symbol
This can be used to provide a wrapper for a system function. The wrapper function should be
called
__wrap_
Here is a trivial example:
void *
__wrap_malloc (int c)
{
printf ("malloc called with %ld\n", c);
return __real_malloc (c);
}
If you link other code with this file using
function
__wrap_malloc
the real
malloc
You may wish to provide a
option will succeed. If you do this, you should not put the definition of
same file as
__wrap_malloc
a chance to wrap it to
-enable-new-dtags
-disable-new-dtags
This linker can create the new dynamic tags in ELF. But the older ELF systems may not under-
stand them. If you specify
you specify
-disable-new-dtags
dynamic tags are not created. Note that those options are only available for ELF systems.
3.1.1. Options Specific to i386 PE Targets
The i386 PE linker supports the
library (DLL) instead of a normal executable. You should name the output
command does not specify a start address for the section (refer to Section
symbol
. Any undefined reference to
. If it wishes to call the system function, it should call
symbol
instead. The call to
function.
__real_malloc
; if you do, the assembler may resolve the call before the linker has
.
malloc
-enable-new-dtags
-shared
. Second, don't forget to use
. Any undefined reference to
__real_
symbol
-wrap malloc
__real_malloc
function as well, so that links without the
, the dynamic tags will be created as needed. If
, no new dynamic tags will be created. By default, the new
option, which causes the output to be a dynamically linked
-whole-archive
-Wl,-no-whole-archive
will be resolved to
symbol
will be resolved to
__real_
, then all calls to
malloc
in
__wrap_malloc
__real_malloc
when you use this
*.dll
21
option, include
.
symbol
.
symbol
will call the
will call
-wrap
in the

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 3

Table of Contents