[PATCH] MC: Implement COFF .linkonce directive

Rafael Espíndola rafael.espindola at gmail.com
Fri Jul 5 06:53:52 PDT 2013


> Rafael Ávila de Espíndola wrote:
>> This is the same as the gnu assembler, no? Do we consider it an extension because it is not what the native tools do?
> GAS doesn't support associative, largest and newest. Also, the GAS documentation is wrong when it mentions warnings for the others, at least according to the PECOFF spec and Microsoft's linker, which issues errors.

OK

> ----------------
> Rafael Ávila de Espíndola wrote:
>> Why these fields need to be mutable? The equivalent ones in MCSectionELF are not.
> I agree mutable is not ideal, but MCStreamer::getCurrentSection() returns only pointers to const and I don't see any other way to retrieve the current section. This is also the only instance of a setter on a section type. How would you prefer this to be handled? Should I change MCStreamer's interface and add a suitable method? Or just const_cast the returned pointer?

No, this is fine. We should probably refactor the code to avoid it,
but a FIXME is OK for now.

> Rafael Ávila de Espíndola wrote:
>> What is the correct behavior if  .linkonce is specified twice, should we produce an error?
> We probably should. GAS doesn't specify this, and allows it without any warnings or errors. But the behavior depends on the order of internal constants.

OK. Please add a test showing we implement the desired behavior.




More information about the llvm-commits mailing list