All of lore.kernel.org
 help / color / mirror / Atom feed
* objcopy fix (for x86_64)
@ 2007-11-18 10:47 Robert Millan
  2007-11-18 12:35 ` Marco Gerards
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Millan @ 2007-11-18 10:47 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 478 bytes --]


This prevents objcopy from copying sections other than .text during the
./configure absolute address test.  On i386, our conftest only has .text
and .comment (which is skipped), but on x86_64 there's an additional
.eh_frame section which isn't skipped unless you tell it to.

Just one step further towards x86_64 grub ;-)

Comments?

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)

[-- Attachment #2: objcopy.diff --]
[-- Type: text/x-diff, Size: 618 bytes --]


	* aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Pass `--only-section=.text'
	to objcopy.

diff -ur grub2.old/aclocal.m4 grub2/aclocal.m4
--- grub2.old/aclocal.m4	2007-02-03 12:36:13.000000000 +0100
+++ grub2/aclocal.m4	2007-11-18 11:34:06.000000000 +0100
@@ -61,7 +61,7 @@
   else
     AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr])
   fi
-  if AC_TRY_COMMAND([${OBJCOPY-objcopy} -O binary conftest.exec conftest]); then :
+  if AC_TRY_COMMAND([${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest]); then :
   else
     AC_MSG_ERROR([${OBJCOPY-objcopy} cannot create binary files])
   fi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: objcopy fix (for x86_64)
  2007-11-18 10:47 objcopy fix (for x86_64) Robert Millan
@ 2007-11-18 12:35 ` Marco Gerards
  2007-11-27 11:57   ` Robert Millan
  0 siblings, 1 reply; 5+ messages in thread
From: Marco Gerards @ 2007-11-18 12:35 UTC (permalink / raw)
  To: The development of GRUB 2

Robert Millan <rmh@aybabtu.com> writes:

> This prevents objcopy from copying sections other than .text during the
> ./configure absolute address test.  On i386, our conftest only has .text
> and .comment (which is skipped), but on x86_64 there's an additional
> .eh_frame section which isn't skipped unless you tell it to.
>
> Just one step further towards x86_64 grub ;-)
>
> Comments?
>
> -- 
> Robert Millan
>
> <GPLv2> I know my rights; I want my phone call!
> <DRM> What use is a phone call, if you are unable to speak?
> (as seen on /.)
>
>
> 	* aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Pass `--only-section=.text'
> 	to objcopy.

Looks fine to me.

--
Marco




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: objcopy fix (for x86_64)
  2007-11-18 12:35 ` Marco Gerards
@ 2007-11-27 11:57   ` Robert Millan
  2007-11-27 17:20     ` Pavel Roskin
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Millan @ 2007-11-27 11:57 UTC (permalink / raw)
  To: The development of GRUB 2

On Sun, Nov 18, 2007 at 01:35:22PM +0100, Marco Gerards wrote:
> Robert Millan <rmh@aybabtu.com> writes:
> 
> > This prevents objcopy from copying sections other than .text during the
> > ./configure absolute address test.  On i386, our conftest only has .text
> > and .comment (which is skipped), but on x86_64 there's an additional
> > .eh_frame section which isn't skipped unless you tell it to.
> >
> > Just one step further towards x86_64 grub ;-)
> >
> > Comments?
> >
> > -- 
> > Robert Millan
> >
> > <GPLv2> I know my rights; I want my phone call!
> > <DRM> What use is a phone call, if you are unable to speak?
> > (as seen on /.)
> >
> >
> > 	* aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Pass `--only-section=.text'
> > 	to objcopy.
> 
> Looks fine to me.

Uhm actually, I suppose one would need this argument in two separate places
(the test, and the real thing), which I missed.

I'll have a look again later.

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: objcopy fix (for x86_64)
  2007-11-27 11:57   ` Robert Millan
@ 2007-11-27 17:20     ` Pavel Roskin
  2007-11-27 20:40       ` Christian Franke
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Roskin @ 2007-11-27 17:20 UTC (permalink / raw)
  To: The development of GRUB 2

On Tue, 2007-11-27 at 12:57 +0100, Robert Millan wrote:
> > > 	* aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Pass `--only-section=.text'
> > > 	to objcopy.
> > 
> > Looks fine to me.
> 
> Uhm actually, I suppose one would need this argument in two separate places
> (the test, and the real thing), which I missed.

It won't work "in the real thing".  There are more sections than
just .text that need to be preserved.

In any case, it will be in the yet to be written conf/x86_64-pc.mk

We need to find the real reason behind grub_PROG_OBJCOPY_ABSOLUTE and
relax the test to only find the original problem without impeding new
ports.

-- 
Regards,
Pavel Roskin



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: objcopy fix (for x86_64)
  2007-11-27 17:20     ` Pavel Roskin
@ 2007-11-27 20:40       ` Christian Franke
  0 siblings, 0 replies; 5+ messages in thread
From: Christian Franke @ 2007-11-27 20:40 UTC (permalink / raw)
  To: The development of GRUB 2

Pavel Roskin wrote:
> On Tue, 2007-11-27 at 12:57 +0100, Robert Millan wrote:
>   
>>>> 	* aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Pass `--only-section=.text'
>>>> 	to objcopy.
>>>>         
>>> Looks fine to me.
>>>       
>> Uhm actually, I suppose one would need this argument in two separate places
>> (the test, and the real thing), which I missed.
>>     
>
> It won't work "in the real thing".  There are more sections than
> just .text that need to be preserved.
>
> In any case, it will be in the yet to be written conf/x86_64-pc.mk
>
> We need to find the real reason behind grub_PROG_OBJCOPY_ABSOLUTE and
> relax the test to only find the original problem without impeding new
> ports.
>
>   

The reason for the failing objcopy test may be an unsupported or 
unsuitable "-N" linker option. The linker possibly adds constant bytes 
to some section.

Examining the builtin linker script ("ld -N --verbose") may be helpful 
to track down the problem.

If this script does not work, it can be replaced by a target specific 
version selected by configure. See "[PATCH] Build on Cygwin" for a 
working example.

Christian




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-11-27 20:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-18 10:47 objcopy fix (for x86_64) Robert Millan
2007-11-18 12:35 ` Marco Gerards
2007-11-27 11:57   ` Robert Millan
2007-11-27 17:20     ` Pavel Roskin
2007-11-27 20:40       ` Christian Franke

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.