berkus / mclinker

Automatically exported from code.google.com/p/mclinker
Other
0 stars 0 forks source link

Fail to link gethost on x86 freebsd (maybe related to copyreloc) #84

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It looks like there is something wrong w/ x86 copyreloc? If adding "-z 
nocopyreloc" option, mclinker is able to link gethost.

llvm-mcld.debug --eh-frame-hdr -V -dynamic-linker /libexec/ld-elf.so.1 -o 
gethost /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o 
-L/usr/obj/usr/src/tmp/legacy/usr/lib -L/usr/lib -L/usr/lib -march=x86 
gethost.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed 
-lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o
MCLinker - 1.6.0.0-taroko
Assertion failed: (m_ValidEntryIterator != m_pSectionData->end() && "No empty 
relocation entry for the incoming symbol."), function consumeEntry, file 
../../../mclinker/debug/../lib/Target/OutputRelocSection.cpp, line 62.
Stack dump:
0.      Running pass 'Function Pass Manager' on module 'Empty Module'.
Abort (core dumped)

Original issue reported on code.google.com by pete.c...@gmail.com on 5 Oct 2012 at 2:58

Attachments:

GoogleCodeExporter commented 9 years ago
Fix at revision c1cf4a993354. This is because that when producing COPY 
relocation, we'll reserve an entry in OutputRelocSection and then consume it 
immediately before any other entries have been reserved. If the COPY relocation 
is the first entry we reserve, it'll cause m_ValidEntryIterator to be set to 
m_SectionData->end() and then fail to consume another entry after it.

Original comment by mysekki on 8 Oct 2012 at 3:41