This is the mail archive of the binutils@sources.redhat.com 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]

Re: Memory corruption handling x86 relocs


Hi Fred,

: I have a test case that triggers internal memory corruption in BFD
: when processing x86 relocs during linking.  Basically either BFD is
: incorrectly computing the amount of space needed, or is incorrectly
: trying to store more relocs than it should, overwriting some other
: pointers.

Any luck figuring out exactly what is going wrong ?

: + 	      BFD_ASSERT (sreloc->reloc_count < (sreloc->_raw_size / sizeof (Elf32_External_Rel)));

Why is the test for 'less than' rather than 'less than or equal to' ?

reloc_count is the number of relocs in the section, which if they are
REL type relocs ought to be equal to _raw_size/12, so the above assert
would fail.

Cheers
	Nick


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