[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/12455] Undefined reference error with ld.dk
From: |
davek at gcc dot gnu.org |
Subject: |
[Bug ld/12455] Undefined reference error with ld.dk |
Date: |
Tue, 1 Feb 2011 17:34:52 +0000 |
http://sourceware.org/bugzilla/show_bug.cgi?id=12455
Dave Korn <davek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |davek at gcc dot gnu.org
--- Comment #1 from Dave Korn <davek at gcc dot gnu.org> 2011-02-01 17:34:32
UTC ---
This is the same failure as the LTO 10 testcase from HJ's patch that he
posted the other day(*). I've analysed the cause: the linker fails to respect
the 1-byte alignment of the LTO sections when doing the -r link, so the output
sections come out 4-aligned; e.g., from your testcase:
$ objdump -h foo.o
foo.o: file format pe-i386
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000010 00000000 00000000 000001f4 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
1 .data 00000000 00000000 00000000 00000000 2**2
ALLOC, LOAD, DATA
2 .bss 00000000 00000000 00000000 00000000 2**2
ALLOC
3 .gnu.lto_foo.d4648082 000000aa 00000000 00000000 00000204 2**0
^^^^ correct
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .gnu.lto_.cgraph.d4648082 00000037 00000000 00000000 000002ae 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .gnu.lto_.vars.d4648082 00000012 00000000 00000000 000002e5 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
6 .gnu.lto_.refs.d4648082 00000012 00000000 00000000 000002f7 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
7 .gnu.lto_.statics.d4648082 00000014 00000000 00000000 00000309 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
8 .gnu.lto_.decls.d4648082 00000108 00000000 00000000 0000031d 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
9 .gnu.lto_.symtab.d4648082 00000028 00000000 00000000 00000425 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
10 .gnu.lto_.opts 00000035 00000000 00000000 0000044d 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
11 .eh_frame 00000038 00000000 00000000 00000482 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
address@hidden /gnu/binutils/git.repo/tests/pr12455
$ objdump -h bar.o
bar.o: file format pe-i386
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 0000000c 00000000 00000000 000000b4 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 00000000 00000000 00000000 00000000 2**2
ALLOC, LOAD, DATA
2 .bss 00000000 00000000 00000000 00000000 2**2
ALLOC
3 .eh_frame 00000038 00000000 00000000 000000c0 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
address@hidden /gnu/binutils/git.repo/tests/pr12455
$ objdump -h foobar.o
foobar.o: file format pe-i386
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 0000001c 00000000 00000000 000001f4 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
1 .data 00000000 00000000 00000000 00000000 2**2
ALLOC, LOAD, DATA
2 .gnu.lto_foo.d4648082 000000ac 00000000 00000000 00000210 2**2
^^^^ wrong!
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 .gnu.lto_.cgraph.d4648082 00000038 00000000 00000000 000002bc 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .gnu.lto_.vars.d4648082 00000014 00000000 00000000 000002f4 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .gnu.lto_.refs.d4648082 00000014 00000000 00000000 00000308 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
6 .gnu.lto_.statics.d4648082 00000014 00000000 00000000 0000031c 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
7 .gnu.lto_.decls.d4648082 00000108 00000000 00000000 00000330 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
8 .gnu.lto_.symtab.d4648082 00000028 00000000 00000000 00000438 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
9 .gnu.lto_.opts 00000038 00000000 00000000 00000460 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
10 .eh_frame 00000070 00000000 00000000 00000498 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
11 .bss 00000000 00000000 00000000 00000000 2**2
ALLOC
Increasing the alignment causes the size of the sections also to be rounded
up, leaving a few bytes of stray data at the end that confuse the zlib unpacker
in the lto input streamer. This looks like an assumption somewhere in bfd
about the minimum valid section alignment; I'll work on it next.
--
(*) - http://sourceware.org/ml/binutils/2011-01/msg00383.html
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.