Commit 831b6642 authored by Moritz Angermann's avatar Moritz Angermann Committed by Marge Bot
Browse files

Fix build warning; add more informative information to the linker; fix linker for empty sections

parent 4b4a8b60
Pipeline #18465 failed with stages
in 454 minutes and 10 seconds
......@@ -677,6 +677,14 @@ static int
relocateSection(ObjectCode* oc, int curSection)
{
Section * sect = &oc->sections[curSection];
IF_DEBUG(linker, debugBelch("relocateSection %d, info: %x\n", curSection, sect->info));
// empty sections (without segments), won't have their info filled.
// there is no relocation to be done for them.
if(sect->info == NULL)
return 1;
MachOSection * msect = sect->info->macho_section; // for access convenience
MachORelocationInfo * relocs = sect->info->relocation_info;
MachOSymbol * symbols = oc->info->macho_symbols;
......@@ -1192,7 +1200,7 @@ ocGetNames_MachO(ObjectCode* oc)
SymbolAddr* commonStorage = NULL;
unsigned long commonCounter;
IF_DEBUG(linker,debugBelch("ocGetNames_MachO: start\n"));
IF_DEBUG(linker,debugBelch("ocGetNames_MachO: %s start\n", OC_INFORMATIVE_FILENAME(oc)));
Section *secArray;
secArray = (Section*)stgCallocBytes(
......@@ -1449,7 +1457,7 @@ ocMprotect_MachO( ObjectCode *oc )
int
ocResolve_MachO(ObjectCode* oc)
{
IF_DEBUG(linker, debugBelch("ocResolve_MachO: start\n"));
IF_DEBUG(linker, debugBelch("ocResolve_MachO: %s start\n", OC_INFORMATIVE_FILENAME(oc)));
if(NULL != oc->info->dsymCmd)
{
......@@ -1460,6 +1468,9 @@ ocResolve_MachO(ObjectCode* oc)
for (int i = 0; i < oc->n_sections; i++)
{
const char * sectionName = oc->info->macho_sections[i].sectname;
IF_DEBUG(linker, debugBelch("ocResolve_MachO: section %d/%d: %s\n", i, oc->n_sections, sectionName));
if( !strcmp(sectionName,"__la_symbol_ptr")
|| !strcmp(sectionName,"__la_sym_ptr2")
|| !strcmp(sectionName,"__la_sym_ptr3"))
......@@ -1483,7 +1494,7 @@ ocResolve_MachO(ObjectCode* oc)
}
else
{
IF_DEBUG(linker, debugBelch("ocResolve_MachO: unknown section\n"));
IF_DEBUG(linker, debugBelch("ocResolve_MachO: unknown section %d/%d\n", i, oc->n_sections));
}
}
}
......@@ -1520,7 +1531,7 @@ ocResolve_MachO(ObjectCode* oc)
for(int i = 0; i < oc->n_sections; i++)
{
IF_DEBUG(linker, debugBelch("ocResolve_MachO: relocating section %d\n", i));
IF_DEBUG(linker, debugBelch("ocResolve_MachO: relocating section %d/%d\n", i, oc->n_sections));
#if defined(aarch64_HOST_ARCH)
if (!relocateSectionAarch64(oc, &oc->sections[i]))
......
......@@ -71,7 +71,6 @@ Time getCurrentThreadCPUTime(void)
// support clock_getcpuclockid. Hence we prefer to use the Darwin-specific
// path on Darwin, even if clock_gettime is available.
#if defined(darwin_HOST_OS)
mach_port_t port = pthread_mach_thread_np(osThreadId());
thread_basic_info_data_t info = { 0 };
mach_msg_type_number_t info_count = THREAD_BASIC_INFO_COUNT;
kern_return_t kern_err = thread_info(mach_thread_self(), THREAD_BASIC_INFO,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment