-
Notifications
You must be signed in to change notification settings - Fork 29
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
Fix LdScript emission #708
Conversation
b16b77e
to
09d3791
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
.comment : { | ||
*(.comment*) | ||
} | ||
.symtab : { | ||
*(.symtab) | ||
} | ||
.shstrtab : { | ||
*(.shstrtab) | ||
} | ||
.strtab : { | ||
*(.strtab) | ||
} | ||
.tctmemtab : { | ||
*(.tctmemtab) | ||
} | ||
.rtstab : { | ||
*(.rtstab) | ||
} | ||
.eoltab : { | ||
*(.eoltab) | ||
} | ||
.chesstypeannotationtab : { | ||
*(.chesstypeannotationtab) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Orthogonal to this PR specifically, but are all of these needed? I.e. aren't some of these metadata and wouldn't we be able to make the elf smaller by excluding those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way this works is with these sections specified explicitly, if any of the ELFs contain these sections, then those sections will be placed at these locations. E.g., this PR failed at first because I turned on =error
and mm.o
had a .chesstypeannotationtab
section that currently gets placed at an arbitrary location.
So the sections are already there and are already getting placed into the ELF. -Wl,--gc-sections
pertains to your question and there I do not know what counts as "unused" and therefore "will be gced". But what I think is intuitively true, if the sections are empty they will be gced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks for the explanation! I am a rookie on ld scripts so will take your word for it :) At some point, it might be interesting to see what sections are actually copied into the elf.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ain't no pro either - 90% of what I'm saying is just stuff I'm absorbing by osmosis by reading PRs/discussions in llvm-aie.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually that's not true - I did actually read some "docs" on it (shocking I know); I read about half of this thing https://mcyoung.xyz/2021/06/01/linker-script/.
09d3791
to
4cbd17b
Compare
4cbd17b
to
ccb8865
Compare
Without explicit locations for these sections, they get placed in arbitrary locations. The introduced linker flag will error out if new sections appear (and don't have specific locations/assignments).
See Xilinx/mlir-aie#1717