Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iQue] Update fado #2437

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tools/fado/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[subrepo]
remote = [email protected]:EllipticEllipsis/fado.git
branch = master
commit = 7fad57f834a86b6a752292996f99f08771f29df4
parent = 17d683780d3878159959a87a9c4a2683d8781ef2
commit = a45f99b46d2f70fb14f4648907f493b28a96a78a
parent = 06904e1ee76828591b42f419a5e4f80106de4615
method = merge
cmdver = 0.4.6
22 changes: 17 additions & 5 deletions tools/fado/lib/fairy/fairy.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,10 @@ void Fairy_InitFile(FairyFileInfo* fileInfo, FILE* file) {
off += 1;
case SHT_REL:
off += 5;
/* This assumes only one reloc section of each name */
// TODO: is this a problem?
{
FairySection relocSection = FAIRY_SECTION_OTHER;
FairyRela* relocs;
size_t relocCount;

/* Ignore the first 5/6 chars, which will always be ".rel."/".rela." */
if (strcmp(&shstrtab[currentSection.sh_name + off], "text") == 0) {
Expand All @@ -381,11 +381,23 @@ void Fairy_InitFile(FairyFileInfo* fileInfo, FILE* file) {
}
FAIRY_DEBUG_PRINTF("Found %s section\n", &shstrtab[currentSection.sh_name]);

relocCount = Fairy_ReadRelocs(&relocs, file, currentSection.sh_type, currentSection.sh_offset,
currentSection.sh_size);

/* Ignore empty reloc sections */
if (relocCount == 0) {
free(relocs);
break;
}

/* This assumes only one non-empty reloc section of each name */
/* TODO: is this a problem? */
assert(fileInfo->relocTablesInfo[relocSection].sectionData == NULL);

fileInfo->relocTablesInfo[relocSection].sectionData = relocs;
fileInfo->relocTablesInfo[relocSection].sectionType = SHT_RELA;
fileInfo->relocTablesInfo[relocSection].sectionEntrySize = sizeof(FairyRela);
fileInfo->relocTablesInfo[relocSection].sectionEntryCount =
Fairy_ReadRelocs((FairyRela**)&fileInfo->relocTablesInfo[relocSection].sectionData, file,
currentSection.sh_type, currentSection.sh_offset, currentSection.sh_size);
fileInfo->relocTablesInfo[relocSection].sectionEntryCount = relocCount;
}
break;

Expand Down