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 relocation


From: Vladimir 'phcoder' Serbinenko
Subject: Re: [PATCH 7/7] RFC: Use correct addresses, eliminate manual relocations
Date: Thu, 16 Jul 2009 17:36:03 +0200

On Thu, Jul 16, 2009 at 5:44 AM, Pavel Roskin<address@hidden> wrote:
> 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.
>
I'm not sure whether supporting old tools is desirable. On one hand
some OSes may have kept old tools for binary compatibility (I think
especially about haiku which has plans to add multiboot support) but
on the other hand since nobody checks a compilation with old tools is
probably broken anyway. What do others think?
>> 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.
>
No that you found a way to compile them I do care. Just after having
done all the workarounds and fixes to compile core and modules I
recieved an allergy to this toolchain but I will continue to support
it even if I won't spend a lot of time on 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.
>
Nice. Now afaik the last barrier to grub-on-darwin to be functional
are trampolines.
>> 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.
>
I'll check them on my OSes
> By the way, Apple cpp defines __APPLE__ and __APPLE_CC__,
Yves Blusseau told me about that just before I went to vacation and so
I haven't made use of this info and Yves submitted no patch despite me
encouraging him to do so
> 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__.
Perhaps in some cases we need something more fine-grained like test if
resulting image is Mach-O since mixed toolchains with some Apple and
some non-Apple components are possible
>
> --
> Regards,
> Pavel Roskin
>
>
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/grub-devel
>



-- 
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git




reply via email to

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