From: Martin Mares <mj@ucw.cz>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86 Boot enhancements, pic 16 4/9
Date: Fri, 5 Apr 2002 12:59:11 +0200 [thread overview]
Message-ID: <20020405105911.GA3116@ucw.cz> (raw)
In-Reply-To: <m11ydwu5at.fsf@frodo.biederman.org> <20020405080115.GA409@ucw.cz> <m1k7rmpmyq.fsf@frodo.biederman.org> <20020405084733.GG609@ucw.cz> <m1g02aplmm.fsf@frodo.biederman.org> <20020405090846.GL609@ucw.cz> <m1bscypjiu.fsf@frodo.biederman.org>
Hello!
> Given that I want a relative offset, and I have explicitly coded a
> relative offset, I don't see how that is a hack. I see assembly
> for is telling the machine explicitly what to do and that does.
No, this is not a relative offset (it would be appropriate if the
program tries to relocate itself), but a genuine address in a program
which always runs from address 0 (relative to some segment, but it
doesn't matter).
> One of the other reasons I want to do it this way is in case is to
> make copying code easier. If you use idioms that work equally well
> everywhere and for every case it is easier to switch between projects
> using the same tool. And the assume 0 hack isn't useful when
> switching from real to protected mode while using the code segment
> you got from the reset vector. Although it is kind of fun running
> real mode code with a code segment base of 0xffff0000.
Agreed, but in this case it's perfectly clear that the code will run
from address 0, so it should be written as such.
For such purposes, it would be wonderful if somebody could teach gas
how to assemble absolute code and make real location of code and base
for calculation of symbols independent. It probably could be done with
sections and a cleverly written ldscript (modulo ld bugs), but it's
nowhere near elegant.
Have a nice fortnight
--
Martin `MJ' Mares <mj@ucw.cz> http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
A student who changes the course of history is probably taking an exam.
next prev parent reply other threads:[~2002-04-05 10:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-03 16:15 [PATCH] x86 Boot enhancements, pic 16 4/9 Eric W. Biederman
2002-04-03 19:40 ` H. Peter Anvin
2002-04-04 2:54 ` Eric W. Biederman
2002-04-05 8:01 ` Martin Mares
2002-04-05 8:29 ` Eric W. Biederman
2002-04-05 8:47 ` Martin Mares
2002-04-05 8:58 ` Eric W. Biederman
2002-04-05 9:08 ` Martin Mares
2002-04-05 9:44 ` Eric W. Biederman
2002-04-05 10:59 ` Martin Mares [this message]
2002-04-05 16:24 ` Maciej W. Rozycki
2002-04-05 20:59 ` Eric W. Biederman
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=20020405105911.GA3116@ucw.cz \
--to=mj@ucw.cz \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox