grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 7/7] RFC: Use correct addresses, eliminate manual relocations


From: Pavel Roskin
Subject: Re: [PATCH 7/7] RFC: Use correct addresses, eliminate manual relocations
Date: Wed, 15 Jul 2009 23:44:35 -0400
User-agent: Internet Messaging Program (IMP) H3 (4.1.4)

Quoting Vladimir 'phcoder' Serbinenko <address@hidden>:

Sorry for the second reply.  I have some new data now.

AFAIR during compilation process relocation entries are preserved and
resolved only in the last step. Now thinking it should work even
without .bss.

I wrongly assumed that I need it to eliminate the ABS macro, which is quite intrusive. It turns out ABS can be eliminated without any .bss sections. I have no idea why ABS appeared originally. Maybe some really old tools couldn't deal with the relocations.

Anyway don't care much about compiling bootsectors under
darwin.

We have to care, as we have a lot of preprocessor directives in the bootsector sources, and they stand in the way of other changes. We should either maintain that code or discard it.

Apple's CC generates longer opcodes which breaks bootsectors.

You mean Apple assembler. And I know why it happens. The Apple assembler assumes unknown labels to be global and generates long jumps. I looked at the source and it looks like only labels starting with "L" are considered local.

I prepended "L_" to all labels that are used for jumps, and now the Apple assembler creates exactly the same boot.img as the native Linux assembler.

Untill someone finds a fix darwin users will have to use bootsectors
compiled under linux. It's not a huge problem since very few
developpers need to modify boot sector

I think I have a fix. I'll post both patches for boot.S - one to remove Apple preprocessor directives and the other to remove ABS. If both work for everyone (I'm worried about Cygwin), we can go ahead with other files.

By the way, Apple cpp defines __APPLE__ and __APPLE_CC__, so we don't need to define APPLE_CC. But I hope to get rid of APPLE_CC in most places before the rest is converted to __APPLE__.

--
Regards,
Pavel Roskin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]