This test passes just fine on x86, but fails as follows on x86_64: 1) testObjectFile(lib.elf.tests.TestElf)junit.framework.AssertionFailedError: section-1-alignment expected:<0> but was:<4> at lib.elf.tests.TestElf.testObjectFile(TestRunner) at frysk.junit.Runner.runCases(TestRunner) at frysk.junit.Runner.runArchCases(TestRunner) at frysk.junit.Runner.runTestCases(TestRunner) at TestRunner.main(TestRunner)
Note that this test was disabled till recently according to bug #2712
Created attachment 1470 [details] `AC_SYS_LARGEFILE' for whole Frysk as elfutils is using it This patch should be reviewed by a Frysk architect as I am not sure if this change really needs to be global. It is definitely needed for any code sharing ABI with elfutils as elfutils is already using it. It is also needed for any code accessing arbitrary files, which can be possibly larger than 2GB. Currently the layout: /* Descriptor for data to be converted to or from memory format. */ typedef struct { void *d_buf; /* Pointer to the actual data. */ Elf_Type d_type; /* Type of this piece of data. */ unsigned int d_version; /* ELF version. */ size_t d_size; /* Size in bytes. */ off_t d_off; /* Offset into section. */ size_t d_align; /* Alignment in section. */ } Elf_Data; was handled differently in different parts of Frysk as `off_t' was sometimes compiled on i686 as 4 bytes and sometimes as 8 bytes, therefore in some cases `d_align' was fetched from a wrong offset. After this `AC_SYS_LARGEFILE' fix gets committed the testcase frysk-imports$ ./TestRunner lib.elf.tests.TestElf needs to be updated as currently it expects the buggy value 0 everywhere, there should be some `expectedDataAlignments' and the alignments should match the column `Al' of the output of: frysk-imports$ readelf -a ./frysk/pkgdatadir/helloworld.o
Created attachment 1472 [details] alignment info for Elf test This adds the allignment info to the test. This works well on x86_64, but not on x86 where the read data always seems to come out as zero.
Committed the patch of Comment 2 (to `common/'), after Andrew Cagney's approval.