[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gas listing option changes the size of the .eh_frame section
From: |
Richard Sharman |
Subject: |
gas listing option changes the size of the .eh_frame section |
Date: |
Sun, 17 Feb 2002 02:26:09 GMT |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 |
Why does the gas listing option change the size of the .eh_frame section?
[This occurs with gas 2.11.90.0.8, but not with version 2.9.5]
The following example demonstrates what I mean.
A trivial C++ program is compiled, stopping after the assembler file is
produced. A copy of it is taken. When compiling the two assembler
programs with and without the -a option the resulting object files
differ in the .eh_frame section.
The first diff shows the differences of "objdump -h", showing the
differences in sizes of the section.
The second diff shows the differences of the .eh_frame section itself.
% cat run
#! /bin/sh
set -v
cat a.cc
g++ -S -o a.s a.cc
cp a.s b.s
as -o a.o a.s
as -o b.o -Wa b.s > List
ls -l a.o b.o
objdump -h a.o > D1
objdump -h b.o > D2
diff D1 D2
objdump -j .eh_frame -s -r a.o > D3
objdump -j .eh_frame -s -r b.o > D4
diff D3 D4
% ./run
cat a.cc
#include <iostream.h>
int main(void) {
cout << "hello, world" << endl;
exit(0);
}
g++ -S -o a.s a.cc
cp a.s b.s
as -o a.o a.s
as -o b.o -Wa b.s > List
ls -l a.o b.o
-rw-r--r-- 1 sharman gx5000 1364 Feb 14 16:37 a.o
-rw-r--r-- 1 sharman gx5000 1376 Feb 14 16:37 b.o
objdump -h a.o > D1
objdump -h b.o > D2
diff D1 D2
2c2
< a.o: file format elf32-i386
---
> b.o: file format elf32-i386
16c16
< 5 .eh_frame 00000030 00000000 00000000 000000b4 2**2
---
> 5 .eh_frame 0000003c 00000000 00000000 000000b4 2**2
18c18
< 6 .comment 00000026 00000000 00000000 000000e4 2**0
---
> 6 .comment 00000026 00000000 00000000 000000f0 2**0
objdump -j .eh_frame -s -r a.o > D3
objdump -j .eh_frame -s -r b.o > D4
diff D3 D4
2c2
< a.o: file format elf32-i386
---
> b.o: file format elf32-i386
11,12c11,13
< 0010 88010000 18000000 18000000 00000000 ................
< 0020 44000000 410e0885 02420d05 582e1000 D...A....B..X...
---
> 0010 88010000 24000000 18000000 00000000 ....$...........
> 0020 44000000 04010000 000e0885 02040200 D...............
> 0030 00000d05 04180000 002e1000 ............
%
Versions:
% gcc -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/specs
gcc version 2.95.3 20010315 (release)
% as --version
GNU assembler 2.11.90.0.8
Copyright 2001 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
This assembler was configured for a target of `i386-redhat-linux'.
% objdump --version
GNU objdump 2.11.90.0.8
Copyright 1997, 98, 99, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
%
When I tried with 2.9.5 gas the problem did not occur.
Richard Sharman
- gas listing option changes the size of the .eh_frame section,
Richard Sharman <=