Skip to content

Commit

Permalink
git subrepo pull tools/fado (#2437)
Browse files Browse the repository at this point in the history
subrepo:
  subdir:   "tools/fado"
  merged:   "a45f99b46"
upstream:
  origin:   "[email protected]:EllipticEllipsis/fado.git"
  branch:   "master"
  commit:   "a45f99b46"
git-subrepo:
  version:  "0.4.6"
  origin:   "[email protected]:ingydotnet/git-subrepo.git"
  commit:   "110b9eb"
  • Loading branch information
cadmic authored Jan 22, 2025
1 parent 06904e1 commit b97a21c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
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

0 comments on commit b97a21c

Please sign in to comment.