This is extracted from D2232, i.e. needed to generate line table information.
Diff Detail
Event Timeline
Are these llvm extensions to the gas syntax? If so, please document
them in docs/Extensions.rst.
lib/MC/MCAssembler.cpp | ||
---|---|---|
963 | Data.size() is always 4. The initialization use 4 zero bytes, so this always returns false, no? If so, why is this part of the relaxation? |
Mostly addressed the review comments (questions to follow).
Re: gas - I'm not very familiar with it, but I couldn't find any equivalent of .secref and .offset there.
Also added some docs (to be tried with doxygen, "compiling...").
Re: gas - was looking here https://sourceware.org/binutils/docs/as/Pseudo-Ops.html
lib/MC/MCAssembler.cpp | ||
---|---|---|
963 |
Yeah - good catch.
I'm not very familiar with the code, so might be doing this wrong. | |
test/MC/COFF/secref.s | ||
9 | Added more tests | |
test/MC/COFF/static_offset.s | ||
16 | OK, done. |
lib/MC/MCAssembler.cpp | ||
---|---|---|
947 | Since the size is fixed, this shouldn't need to be part of the relaxation. Relaxation exits for things that can change size depending on where other stuff is. For example, a short branch can become a long one and a uleb might need another byte if things more far apart. What prevents this from being just a data fragment with a relocation to get the correct value? Follow how llvm-mc implements: foo: .zero 4 .zero 4 bar: zed = bar - foo |
2013/12/20 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>:
Comment at: lib/MC/MCAssembler.cpp:947
@@ -939,1 +946,3 @@+bool MCAssembler::relaxCoffStaticOffsetFragment(
+ MCAsmLayout &Layout, MCCoffStaticOffsetFragment &LDF) {
Since the size is fixed, this shouldn't need to be part of the relaxation.
Relaxation exits for things that can change size depending on where other stuff is. For example, a short
branch can become a long one and a uleb might need another byte if things more far apart.
Sorry, I am still very unfamiliar with the MC part of the codebase, I
mostly worked on the Clang part last year.
Thanks for the clarification, I've also looked at the code and I think
now I have at least a vague idea of what relaxations are :)
What prevents this from being just a data fragment with a relocation to get the correct value?
It's just that I'm not familiar with the codebase.
Follow how llvm-mc implements:
foo:
.zero 4 .zero 4bar:
zed = bar - foo
Thanks for the pointer, looking.
In fact, I think I can just use
.int To-From
instead of
.offset from From to To
I'll reduce the patch accordingly soon.
Thanks a lot for the pointer!
Removed the .offset directive part as it's indeed not needed.
Also, renamed "section reference" to "section index".
No need to wait, post-commit should be fine. This seems pretty obviously good, unless there's some gas directive we could be reusing.
Since the size is fixed, this shouldn't need to be part of the relaxation.
Relaxation exits for things that can change size depending on where other stuff is. For example, a short branch can become a long one and a uleb might need another byte if things more far apart.
What prevents this from being just a data fragment with a relocation to get the correct value?
Follow how llvm-mc implements:
foo:
bar:
zed = bar - foo