Red Hat Bugzilla – Bug 45986
Error in linkage of absolute immediate addr operands
Last modified: 2007-04-18 12:33:50 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.0 i686)
Description of problem:
Some but not all references to absolute addresses as immediate
operands appear are incorrectly linked. They link to start of the text
segment rather than than the appropriate data / bss addr.
Steps to Reproduce:
<See attached source-code>
0x805b150 <idct_mmx>: push %ebp
0x805b151 <idct_mmx+1>: mov %esp,%ebp
0x805b153 <idct_mmx+3>: push %eax
0x805b154 <idct_mmx+4>: push %ebx
0x805b155 <idct_mmx+5>: push %ecx
0x805b156 <idct_mmx+6>: push %edx
0x805b157 <idct_mmx+7>: push %edi
0x805b158 <idct_mmx+8>: mov 0x8(%ebp),%eax
0x805b15b <idct_mmx+11>: mov $0x0,%edi
0x805b160 <idct_mmx+16>: lea 0x805b150,%ebx
Ouch! Points to code seg!
0x805b166 <idct_mmx+22>: lea 0x805b150,%ecx
0x805b16c <idct_mmx+28>: lea 0x8061fa8,%edx
0x805b172 <idct_mmx+34>: jmp 0x805b190 <lpa>
Created attachment 21826 [details]
Source code demonstrating bug
Which version of nasm? Does the version in Rawhide (0.98-7) help?
We are seeing the same issues. The problem is actually introduced in the
nasm-0.98-boguself.patch in the nasm source rpm. Altering the SPEC file to not
patch the source tree and then rebuilding the rpm corrects this issue for us.
HJ, this was your patch... comments?
Created attachment 22487 [details]
The current patch as of 2001-07-02
I just uploaded my current patch. It works with all testcases I have.
Can the reporter give the updated patch a try?
Still awaiting feedback from the reporter on whether or not the patch helps.
FYI, the proposed patch fixes a problem with LAME 3.89beta.
It dumps core when compiled with nasm-0.98-7 but works with the proposed patch.
Build and test command:
bash% CC=kgcc ./configure --enable-nasm --enable-extopt=full ; make ; make test
Note that when gcc-2.96 is used instead of kgcc (egcs-2.91.66) other problems occur, unrelated to nasm.
Correction to last note: the build command is just
CC=kgcc ./configure --enable-nasm ; make ; make test
Fix in nasm-0.98-8