Subject: Re: ld --entry 0
From: [email-masked] (Marty Leisner)

4 Jun 1998 10:02:25 -0700
Message-ID: <[email-masked]>
References: <[email-masked]>
To: Stephen Smith <[email-masked]>
Cc: gnu-win32 <[email-masked]>

In message <[email-masked]>,   you write:
>I need to create for test purposes,  a dll that has "entrypoint RVA = 0" where 0 is the number not the character.
>
>If I use ld --entry 0, ld assumes that "0" is a symbol.
>
>How do I tell it otherwise.
>
>Does anyone have the source for the port of  ld.exe
>
>BTW, this site is using b18.1
>
>Stephen
>
>-
You should be able to (with some patience).

Read the GNU ld manual on "The Entry Point"

File: ld.info,  Node: Entry Point,  Next: Version Script,  Prev: PHDRS,  Up: Commands

The Entry Point
===============

   The linker command language includes a command specifically for
defining the first executable instruction in an output file (its "entry
point").  Its argument is a symbol name:
     ENTRY(SYMBOL)

   Like symbol assignments, the `ENTRY' command may be placed either as
an independent command in the command file, or among the section
definitions within the `SECTIONS' command--whatever makes the most
sense for your layout.

   `ENTRY' is only one of several ways of choosing the entry point.
You may indicate it in any of the following ways (shown in descending
order of priority: methods higher in the list override methods lower
down).
   * the `-e' ENTRY command-line option;

   * the `ENTRY(SYMBOL)' command in a linker control script;

   * the value of the symbol `start', if present;

   * the address of the first byte of the `.text' section, if present;

   * The address `0'.

   For example, you can use these rules to generate an entry point with
an assignment statement: if no symbol `start' is defined within your
input files, you can simply define it, assigning it an appropriate
value--

     start = 0x2020;

The example shows an absolute address, but you can use any expression.
For example, if your input object files use some other symbol-name
convention for the entry point, you can just assign the value of
whatever symbol contains the start address to `start':

     start = other_symbol ;

Hope this helps...

marty
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".