public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Martin Mares <mj@ucw.cz>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86 Boot enhancements, pic 16 4/9
Date: 05 Apr 2002 13:59:59 -0700	[thread overview]
Message-ID: <m14ripq2sw.fsf@frodo.biederman.org> (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> <20020405105911.GA3116@ucw.cz>

Martin Mares <mj@ucw.cz> writes:

> 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. 

Agreed.  This is what is really wanted for gas to know that %ds
points to the start of .text or some other section.  This would allow
gas to resolve section relative addresses without asking for
assistance from the linker.  Or if it did ask for assistance the
linker could give the desired answer...

> It probably could be done with
> sections and a cleverly written ldscript (modulo ld bugs), but it's
> nowhere near elegant.

I have two ideas to clear up the picture a little, and still retain
the full usefulness of the .o files.  Since the code is relocatable
it is simply nonsense to directly use any of the addresses it
exports.  All that is interesting are the load addresses, and relative
offsets.

replace ``foo - start'' with: ``D(foo)'' where the macro does the
work.

Or use a linker script of the form:
.bootsect 0 : AT(0x90000) {
	*(.bootsect)
}
.setup 0 : AT(0x90200) {
	*(.setup)
}

The ld bugs I have seen have mostly been related to choosing file
offsets to store the data, and ELF program headers, so I this
shouldn't tickle any of ld's bugs.

Which form do you prefer?

Eric


      parent reply	other threads:[~2002-04-05 21:06 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
2002-04-05 16:24               ` Maciej W. Rozycki
2002-04-05 20:59               ` Eric W. Biederman [this message]

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=m14ripq2sw.fsf@frodo.biederman.org \
    --to=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mj@ucw.cz \
    /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