From: Michal M. <ak...@ja...> - 2012-08-11 16:43:01
|
On Sat, Aug 11, 2012 at 05:17:27PM +0200, Kai Wang wrote: > On Sat, Aug 11, 2012 at 08:53:19AM +0200, Michal Mazurek wrote: > > On Sat, Aug 11, 2012 at 12:18:55AM +0200, Kai Wang wrote: > > > Hi, > > > > > > On Fri, Aug 10, 2012 at 02:16:28PM +0200, Michal Mazurek wrote: > > > > Hello, > > > > > > > > I'm trying to get elftoolchain to work on Bitrig, an OpenBSD fork. > > > > > > > > > > > > Elftoolchain compiles after applying the attached patch, but strip seems > > > > to have a bug. Here is the difference between a binary stripped with gnu > > > > strip, and elftoolchain strip: > > > > > > Thanks for reporting this bug. Could you please put the binary file > > > you used to test strip somewhere online, or email it to me? > > > > I uploaded the binary files here (the make program): > > http://akfaew.jasminek.net/crap/elftoolchain/ > > > > make.notstripped - not stripped > > make.elf - stripped with elftoolchain > > make.gnu - stripped with gnu strip > > Thanks. It should be fixed by r2540. Let me know if it still doesn't > work for you. Thank you, I managed to build world now, however there is still a difference. Stripping the uploaded binary make.notstripped with gnu strip and elftoolchain strip produces this difference: --- dump.elf Wed Aug 8 11:28:00 2012 +++ dump.gnu Wed Aug 8 11:27:57 2012 @@ -19,16 +19,16 @@ program header: entry: 0 p_type: PT_PHDR p_offset: 64 p_vaddr: 0x400040 p_paddr: 0x400040 - p_filesz: 672 - p_memsz: 672 + p_filesz: 560 + p_memsz: 560 p_flags: PF_X|PF_R p_align: 8 entry: 1 p_type: PT_INTERP p_offset: 736 p_vaddr: 0x4002e0 >From the output of hexdump it seems this is the only difference, and thus might be a bug: $ diff hex.elf hex.gnu 7c7 < 00000060 a0 02 00 00 00 00 00 00 a0 02 00 00 00 00 00 00 |................| --- > 00000060 30 02 00 00 00 00 00 00 30 02 00 00 00 00 00 00 |0.......0.......| This warning generated by clang might also interest you: ===> readelf clang -O3 -pipe -pipe -I. -I/usr/ports/pobj/bitrig-elftoolchain-2540/elftoolchain-2540/readelf -I../common -I../libdwarf -I../libelf -I../libelftc -I/usr/local/include -nostdinc -idirafter /usr/include -c readelf.c readelf.c:6135:44: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand] if ((re->options & RE_VV) || (re->options && RE_S)) ^ ~~~~ readelf.c:6135:44: note: use '&' for a bitwise operation if ((re->options & RE_VV) || (re->options && RE_S)) ^~ & readelf.c:6135:44: note: remove constant to silence this warning if ((re->options & RE_VV) || (re->options && RE_S)) ~^~~~~~~ 1 warning generated. -- Michal Mazurek |