[mailto:meta...@gmail.com] On Behalf Of Richard Smith
Sent: Friday, December 11, 2015 12:57 PM
To: Gao, Yunzhong
Cc: Nick Lewycky; Clang Commits
Subject: Re: PATCH: error on code that redeclares with an __asm__ label after
the first ODR use
On Fri, Dec 11, 2015 at 12:43 PM, Gao, Yunzhong via cfe-commits
>>>
>>>
>>> void f();
>>>
>>> void g() __asm__(“real_g”); // rename g into real_g.
>>>
>>>
>>>
>>> void f() {
>>>
>>> g(); // this would actually be calling real_g()
>>>
>>> }
>>>
;t issue an error on the case Yunzhong actually
supplied. Joerg has pointed out over IRC that this is a really useful
construct and that NetBSD's stack smashing protection uses it. We shouldn't
break that. I've added a testcase to make sure it continues working. Please
review!
Nick
Lo
ose asm name is "real_g", and we
have a function whose source-level name is "real_g()" and whose asm name is
"gold". What's wrong with that?
> Looks good to me. Thanks!
>
> - Gao
>
>
>
>
>
> *From:* Nick Lewycky [mailto:nlewy...@goo
...@google.com]
Sent: Friday, December 11, 2015 12:44 AM
To: Gao, Yunzhong
Cc: Clang Commits
Subject: Re: PATCH: error on code that redeclares with an __asm__ label after
the first ODR use
On 10 December 2015 at 17:42, Gao, Yunzhong
mailto:yunzhong_...@playstation.sony.com>>
wrote:
Out of curiosi
;gold", but changing the asm label in a program is highly
dubious. I added an error for this too.
Thanks!
> *From:* cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] *On
> Behalf Of *Nick Lewycky via cfe-commits
> *Sent:* Thursday, December 10, 2015 3:15 PM
> *To:
PR22830 shows a case where some code was adding an __asm__ label after the
first use of a function. GCC and Clang diverged on this code, GCC emitting
the name in the last __asm__ label for all uses while clang would switch in
the middle of the TU as the redeclaration was parsed. The attached patch