mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 628618 part 5 - Don't set DT_REL*COUNT if it wasn't already set. r=tglek,a=sdwilsh
This commit is contained in:
parent
3a7abc2fb4
commit
cc0eedf4c6
@ -619,15 +619,21 @@ ElfSegment *ElfSegment::splitBefore(ElfSection *section)
|
||||
return segment;
|
||||
}
|
||||
|
||||
ElfSection *ElfDynamic_Section::getSectionForType(unsigned int tag)
|
||||
ElfValue *ElfDynamic_Section::getValueForType(unsigned int tag)
|
||||
{
|
||||
for (unsigned int i = 0; i < shdr.sh_size / shdr.sh_entsize; i++)
|
||||
if (dyns[i].tag == tag)
|
||||
return dyns[i].value->getSection();
|
||||
return dyns[i].value;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ElfSection *ElfDynamic_Section::getSectionForType(unsigned int tag)
|
||||
{
|
||||
ElfValue *value = getValueForType(tag);
|
||||
return value ? value->getSection() : NULL;
|
||||
}
|
||||
|
||||
void ElfDynamic_Section::setValueForType(unsigned int tag, ElfValue *val)
|
||||
{
|
||||
unsigned int i;
|
||||
|
@ -355,7 +355,8 @@ int do_relocation_section(Elf *elf, unsigned int rel_type)
|
||||
ElfLocation *init = new ElfLocation(relhackcode, 0);
|
||||
dyn->setValueForType(DT_INIT, init);
|
||||
// TODO: adjust the value according to the remaining number of relative relocations
|
||||
dyn->setValueForType(Rel_Type::d_tag_count, new ElfPlainValue(0));
|
||||
if (dyn->getValueForType(Rel_Type::d_tag_count))
|
||||
dyn->setValueForType(Rel_Type::d_tag_count, new ElfPlainValue(0));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -452,6 +452,7 @@ public:
|
||||
|
||||
void serialize(std::ofstream &file, char ei_class, char ei_data);
|
||||
|
||||
ElfValue *getValueForType(unsigned int tag);
|
||||
ElfSection *getSectionForType(unsigned int tag);
|
||||
void setValueForType(unsigned int tag, ElfValue *val);
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user