This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Broken .loc directive in GAS


Richard Henderson told me that:
On Thu, Jul 10, 2003 at 05:36:08PM +0200, Michal Ludvig wrote:
Offset 0x52 points 2 bytes beyond the end of the section ...

Well, that would be a bug, certainly. Test case?

Test case was in my first posting - attached file temp.cc (attaching it once again). Compile it either on i386 or amd64 (both on SuSE Linux 8.2, but using compilers and binutils from CVS) and link it. Then examine the resulting 'temp' elf file via 'readelf -wl temp' and look for information about 'temp.cc' file:


**********
 The File Name Table:
  Entry Dir     Time    Size    Name
  1     0       0       0       temp.cc

 Line Number Statements:
  Extended opcode 2: set Address to 0x80483c6
  Special opcode 13: advance Address by 0 to 0x80483c6 and Line by 8 to 9
  Special opcode 47: advance Address by 3 to 0x80483c9 and Line by 0 to 9
  Advance PC by 3 to 80483cc
  Extended opcode 1: End of Sequence

  Extended opcode 2: set Address to 0x80483c0
  Special opcode 13: advance Address by 0 to 0x80483c0 and Line by 8 to 9
  Special opcode 47: advance Address by 3 to 0x80483c3 and Line by 0 to 9
  Advance PC by 3 to 80483c6
  Extended opcode 1: End of Sequence

Extended opcode 2: set Address to 0x8048364
Advance Line by 16 to 17
Copy
Special opcode 230: advance Address by 16 to 0x8048374 and Line by 1 to 18
[...]
Special opcode 89: advance Address by 6 to 0x80483ac and Line by 0 to 13
Advance PC by 22 to 80483c2
Extended opcode 1: End of Sequence
**********


As you can see - second sequence begins at 0x80483c0 while the third one ends at 80483c2, i.e. two bytes beyond the start of the second sequence.
(i386 addresses).


Is this a valid testcase?

Michal Ludvig
--
* SuSE CR, s.r.o     * mludvig@suse.cz
* (+420) 296.545.373 * http://www.suse.cz
template<class T>
class T5 {
public:
    T5(int);
};

template<class T>
T5<T>::T5(int val)
{
}


T5<int> t5i(2);
template class T5<int>;

int main()
{
  return 0;  
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]