From: Maciej Hrebien <m_hrebien@wp.pl>
To: linux-assembly@vger.kernel.org
Subject: Re: Prblem with AT&T
Date: Wed, 14 Aug 2002 20:40:27 +0200 [thread overview]
Message-ID: <3D5AA41B.BCD1844F@wp.pl> (raw)
In-Reply-To: 20020814063531.427.qmail@web14507.mail.yahoo.com
Anticipating a Reply wrote:
>
> Hello Maciej !
>
> Thanks for your help , and the code
> now works fine .
>
> Can you please help me understand how
> you decided the addresses to use for
> the text and data section .
>
> I could not figure out how you
> decided to use specifically 0x1c
> for the data section .
Oops! It should be 0x18, sorry! ;) 0x1c works too but it adds 4 zeros
(as a padding) at the end of text section and You don't need it, do You?
> Can you please explain what addresses
> are these referring to ?
>
> Thanks in Advance .
>
> With Regards
>
> ld --oformat binary -Ttext 0x0 -Tdata 0x1c -o sect2
> sect2.o
The "-Ttext" and "-Tdata" options tell the linker what is the base
address of text and data segment of the output file (man ld). ld links
Your code in binary format so it's good to tell him how he must "look"
at the code to link it as You wish. In Your "module" there is nothing
before text section, it's the first section, so the starting address is
set to 0x0. 0x18 bytes (or 0x1c in the fat version ;)) after text
section there is the data section which holds the beautiful string. You
must tell ld explicitly where it is to avoid default behavior which i
think isn't good for You (pad with 0x1000 zeros!). Keep in mind that You
are working with binary format and You are decideing how the result of
linking looks.
Regards
--
Maciej Hrebien
next prev parent reply other threads:[~2002-08-14 18:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-08 7:31 Prblem with AT&T Anticipating a Reply
2002-08-08 8:02 ` Frederic Marmond
2002-08-08 9:28 ` Anticipating a Reply
2002-08-08 16:04 ` Maciej Hrebien
2002-08-10 4:41 ` Anticipating a Reply
2002-08-10 11:47 ` Maciej Hrebien
2002-08-10 19:35 ` Maciej Hrebien
2002-08-14 6:35 ` Anticipating a Reply
2002-08-14 18:40 ` Maciej Hrebien [this message]
2002-08-16 4:55 ` Anticipating a Reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3D5AA41B.BCD1844F@wp.pl \
--to=m_hrebien@wp.pl \
--cc=linux-assembly@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.