From 5ef42e983898f59a49b90f56dd9a7bb0bbdc28f1 Mon Sep 17 00:00:00 2001 From: Rafal Harabien Date: Thu, 8 Dec 2011 19:02:04 +0000 Subject: [PATCH] [RSYM] - Don't strip relocations for some sections. Linker knows better if they are needed. Fixes removed relocations for delayed imports in idata section. Bug traced by me, Timo and Amine. See issue #6618 for more details. svn path=/trunk/; revision=54613 --- reactos/tools/rsym/rsym.c | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/reactos/tools/rsym/rsym.c b/reactos/tools/rsym/rsym.c index 2c55fa7751d..3894d406dea 100644 --- a/reactos/tools/rsym/rsym.c +++ b/reactos/tools/rsym/rsym.c @@ -431,35 +431,6 @@ FindSectionForRVA(DWORD RVA, unsigned NumberOfSections, PIMAGE_SECTION_HEADER Se return NULL; } -static int -IncludeRelocationsForSection(PIMAGE_SECTION_HEADER SectionHeader) -{ - static char *BlacklistedSections[] = - { - ".edata", - ".idata", - ".reloc" - }; - char SectionName[IMAGE_SIZEOF_SHORT_NAME]; - unsigned i; - - if (0 != (SectionHeader->Characteristics & IMAGE_SCN_LNK_REMOVE)) - { - return 0; - } - - for (i = 0; i < sizeof(BlacklistedSections) / sizeof(BlacklistedSections[0]); i++) - { - strncpy(SectionName, BlacklistedSections[i], IMAGE_SIZEOF_SHORT_NAME); - if (0 == memcmp(SectionName, SectionHeader->Name, IMAGE_SIZEOF_SHORT_NAME)) - { - return 0; - } - } - - return 1; -} - static int ProcessRelocations(ULONG *ProcessedRelocsLength, void **ProcessedRelocs, void *RawData, PIMAGE_OPTIONAL_HEADER OptHeader, @@ -505,7 +476,7 @@ ProcessRelocations(ULONG *ProcessedRelocsLength, void **ProcessedRelocs, { TargetSectionHeader = FindSectionForRVA(BaseReloc->VirtualAddress, NumberOfSections, SectionHeaders); - if (NULL != TargetSectionHeader && IncludeRelocationsForSection(TargetSectionHeader)) + if (NULL != TargetSectionHeader) { AcceptedRelocs = *ProcessedRelocs; Found = 0;