This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Added support for extern "c++" local symbols in version script.
ClosedPublic

Authored by grimar on Nov 14 2016, 5:08 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar updated this revision to Diff 77793.Nov 14 2016, 5:08 AM
grimar retitled this revision from to [ELF] - Added support for extern "c++" local symbols in version script..
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar, davide.
ruiu added inline comments.Nov 14 2016, 11:00 AM
ELF/LinkerScript.cpp
1799–1808 ↗(On Diff #77793)

We have very similar code in readGlobal. Can you factor it out?

grimar updated this revision to Diff 77969.Nov 15 2016, 3:00 AM
  • Addressed review comments.
ELF/LinkerScript.cpp
1799–1808 ↗(On Diff #77793)

Done.

ruiu added inline comments.Nov 15 2016, 10:53 AM
ELF/LinkerScript.cpp
1810 ↗(On Diff #77969)

I don't think you need Globals. You could just stop reading until local: in any context.

grimar updated this revision to Diff 78150.Nov 16 2016, 2:01 AM
  • Rebased, addressed comment.
grimar added inline comments.Nov 16 2016, 2:03 AM
ELF/LinkerScript.cpp
1810 ↗(On Diff #77969)

That what seems obvious and was what I first think of.
But also it would parse something like next I think:

...
local:
<locals1>
local:
<local2>
...
It does not look clean.

Actually if you're ok with that, I am fine either,
as I also do not like that flag.

grimar added inline comments.Nov 16 2016, 2:06 AM
ELF/LinkerScript.cpp
1810 ↗(On Diff #77969)

Ah, I see my mistake now, above can't happen, please ignore my comment then.

ruiu accepted this revision.Nov 16 2016, 9:28 AM
ruiu edited edge metadata.

LGTM

ELF/SymbolTable.cpp
721 ↗(On Diff #78150)

Is there any reason to add single quotes? Please remove them because V.Name doesn't contain such quotes.

This revision is now accepted and ready to land.Nov 16 2016, 9:28 AM
grimar added inline comments.Nov 16 2016, 9:31 AM
ELF/SymbolTable.cpp
721 ↗(On Diff #78150)

Lets add them for V.Name ? That is consistent with other messages we added recently

ruiu added inline comments.Nov 16 2016, 9:35 AM
ELF/SymbolTable.cpp
721 ↗(On Diff #78150)

Well, what you pass here is a version name, and that's the right thing to do. If you want to add single quotes, do it in the string in error().

This revision was automatically updated to reflect the committed changes.