#258 Error in ld scripts

Known_bugs
closed
binutils (105)
2004-02-14
2003-01-13
No

Error in ld scripts

Command line: ld -subsystem native --file-alignment
0x20 --section-alignment 0x20 --image-base 0x10000
driver.c -o driver.sys -lntoskrnl

Section .text address is countings as follows:
__image_base__ + __section_alignment__, so we have
section .text address 0x10020. It's incorrect, because
header size is bigger than 0x20.

I suggest to change line

.text __image_base__ + __section_alignment__ :

to

. = __image_base__ + SIZEOF_HEADERS;
.text BLOCK(__section_alignment__) :

in linker scripts.

Discussion

  • Danny Smith

    Danny Smith - 2003-05-06

    Logged In: YES
    user_id=11494

    Thanks for the report, and I'm sorry I've taken so long to
    reply.

    Please report this to binutils list:
    binutils@sources.redhat.com

    The suggested fix will affect other pe-coff targets
    (cygwin and arm-pe) as well as mingw. The binutils list
    should provide you with a more authoritative discussion
    of the issue.

    Danny

     
  • Earnie Boyd

    Earnie Boyd - 2004-02-14

    Logged In: YES
    user_id=15438

    Danny, is this ticket closable?

     
  • Danny Smith

    Danny Smith - 2004-02-14

    Logged In: YES
    user_id=11494

    Closing. The patch needs to be submitted to binutils if the
    OP wants any action.
    Danny

     
  • Danny Smith

    Danny Smith - 2004-02-14
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks