[uml-devel] File corruption with hostfs and GNU Gold linker

2013-01-07 Thread Tristan Schmelcher
Hello,

I am using UML as part of a hermetic build system and I have encountered an
odd file corruption problem with the GNU Gold linker. When linking a binary
inside a UML VM with Gold, if the output path is on a hostfs mount then all
bytes in the output file produced by Gold are zero. However, the size of
the output file is correct and the debugging output from running gold with
--debug suggests that everything is working, so it seems like the content
is being produced by Gold correctly but the file ends up containing all
zeros instead. It has happened 100% of the time so far and it seems to be
independent of the linker command line or input files.

Are there any known issues where hostfs file content could end up as all
zeros?

Repros on both 2.6.34.13 and 3.7.1. I am using GNU binutils 2.21.1.

Much thanks for any help,

Tristan
--
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] File corruption with hostfs and GNU Gold linker

2013-01-07 Thread Richard Weinberger
Am Mon, 7 Jan 2013 17:55:29 -0800
schrieb Tristan Schmelcher :

> Hello,
> 
> I am using UML as part of a hermetic build system and I have
> encountered an odd file corruption problem with the GNU Gold linker.
> When linking a binary inside a UML VM with Gold, if the output path
> is on a hostfs mount then all bytes in the output file produced by
> Gold are zero. However, the size of the output file is correct and
> the debugging output from running gold with --debug suggests that
> everything is working, so it seems like the content is being produced
> by Gold correctly but the file ends up containing all zeros instead.
> It has happened 100% of the time so far and it seems to be
> independent of the linker command line or input files.
> 
> Are there any known issues where hostfs file content could end up as
> all zeros?

Is the file corrupted or does it *always* contain zeros?
If yes, the write command seems to fail.

I'm wondering how gold writes a file.
Can you find out the system call sequence? (E.g using strace).

Thanks,
//richard

--
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel