[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gold/16321] New: Gold generates unnecessary padding for .bss sectio
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug gold/16321] New: Gold generates unnecessary padding for .bss section offset |
Date: |
Wed, 11 Dec 2013 21:22:54 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=16321
Bug ID: 16321
Summary: Gold generates unnecessary padding for .bss section
offset
Product: binutils
Version: 2.25 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: gold
Assignee: ian at airs dot com
Reporter: hjl.tools at gmail dot com
CC: ccoutant at google dot com
address@hidden relro-6]$ cat x.c
static char bss[40];
char const *p1 = &bss[0];
char const p2[1] = { 1 };
address@hidden relro-6]$ make
gcc -fuse-ld=gold -B./ -O2 -fPIC -c -o x.o x.c
./ld.gold -shared -z relro -o libx.so x.o
./strip --strip-debug libx.so -o bar
readelf -lSW bar > new.txt
readelf -lSW libx.so > old.txt
diff -up old.txt new.txt
--- old.txt 2013-12-11 13:19:00.174333763 -0800
+++ new.txt 2013-12-11 13:19:00.170333768 -0800
@@ -1,4 +1,4 @@
-There are 15 section headers, starting at offset 0x11e0:
+There are 15 section headers, starting at offset 0x10d8:
Section Headers:
[Nr] Name Type Address Off Size ES Flg
Lk Inf Al
@@ -11,12 +11,12 @@ Section Headers:
[ 6] .rodata PROGBITS 0000000000000288 000288 000001 00 A
0 0 1
[ 7] .dynamic DYNAMIC 0000000000001f10 000f10 0000f0 10 WA
2 0 8
[ 8] .data PROGBITS 0000000000002000 001000 000008 00 WA
0 0 8
- [ 9] .bss NOBITS 0000000000002020 001020 000028 00 WA
0 0 32
+ [ 9] .bss NOBITS 0000000000002020 001008 000028 00 WA
0 0 32
[10] .comment PROGBITS 0000000000000000 001008 00002d 01 MS
0 0 1
[11] .note.gnu.gold-version NOTE 0000000000000000 001038 00001c
00 0 0 4
- [12] .symtab SYMTAB 0000000000000000 001058 0000d8 18
13 4 8
- [13] .strtab STRTAB 0000000000000000 001130 000030 00
0 0 1
- [14] .shstrtab STRTAB 0000000000000000 001160 00007d 00
0 0 1
+ [12] .shstrtab STRTAB 0000000000000000 001054 00007d 00
0 0 1
+ [13] .symtab SYMTAB 0000000000000000 001498 0001c8 18
14 14 8
+ [14] .strtab STRTAB 0000000000000000 001660 00002c 00
0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings), l (large)
I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
make: *** [all] Error 1
address@hidden relro-6]$
Gold generates
[ 9] .bss NOBITS 0000000000002020 001020 000028 00 WA 0
0 32
Why does gold set offset to 0x1020 instead of 0x1008, which is right
after .data. 0x1020 is the middle of .comment section.
--
You are receiving this mail because:
You are on the CC list for the bug.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug gold/16321] New: Gold generates unnecessary padding for .bss section offset,
hjl.tools at gmail dot com <=