This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Gold Patch to fix ICF bug.

I committed the patch with the changes.

2010-04-23  Sriraman Tallam  <>

	* gc.h (gc_process_relocs): Pass information on relocs pointing to
	sections that are not ordinary to icf.
	* (get_section_contents): Handle relocation pointing to section
	with no object or shndx information.
	* testsuite/ Remove
	* testsuite/ Regenerate.
	* testsuite/ Remove printf.
	* testsuite/ Delete file.

On Fri, Apr 23, 2010 at 10:44 AM, Sriraman Tallam <> wrote:
> On Fri, Apr 23, 2010 at 10:41 AM, Ian Lance Taylor <> wrote:
>> Sriraman Tallam <> writes:
>>>> When I look at this test I don't understand what it is testing. ?It
>>>> seems like the program is always going to run successfully, and you
>>>> aren't testing anything else here. ?What is the point of this test?
>>> In this test, fn1 is folded into fn2 but still the linker must
>>> generate a dynamic relocation for the vtable entry for fn1 as it is a
>>> pie executable and fn1 is virtual. Otherwise, the program segfaults. I
>>> am simply testing this. Is this alright ? I had
>>> icf_virtual_function_folding_test run using a shell script before and
>>> I realized that was not necessary.
>> If it segfaults before your patch and stops segfaulting after your
>> patch then this test is fine. ?I guess I don't yet see why it
>> segfaults before your patch, but I haven't tried running it myself.
> Yes, this was the test case used to expose the bug. Not checking for
> section folding was causing the linker to omit the dynamic reloc
> corresponding to fn1 and this caused the virtual call to crash as it
> was not dynamically relocated.
>> Ian

Attachment: icf_bug_fixes_patch.txt
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]