I'm trying to obtain the Chrome binary build ID from within Chrome source code on Chrome OS. How can this be done?Simon
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
I don't have any CrOS knowledge but I imagine that at some level you have one form of "version" which deterministically points at a given chrome build and system build ? Having to do all sort of ELF headers traversal in chrome just for the sake of knowing which are the right symbols to use seems a bit overkill.
> yes, you can rely on the phdrs always being mappednot if you don't have a PHDR section in the elf which tells the loader to keep them mapped.
> by definition, it's the thing in ELF files that tell the system what & how to actually load the ELF into memoryRight, but nothing requires them to be mapped by definition. The loader have to guarantee to map the sections specified in the elf at the vaddr provided. If nothing loads the PHDR the loader can just throw them away after the loading is done.Anyways, this seems really overkill to lookup the version of the binary.
Why invent some roundabout ways to do that if reliable and [relatively] simple method is available?
On Wed, Jun 29, 2016 at 12:05 PM, Victor Khimenko <kh...@chromium.org> wrote:Why invent some roundabout ways to do that if reliable and [relatively] simple method is available?it's not about inventing roundabouts, The question here is the other way round: why the existing code is not sufficient?
I thought that mapping a Chrome or OS version to symbols was a solved problem
and I was wondering if we could do that in this context without adding new code.
> Why? It's just a simple call to dl_iterate_phdrr with trival callback AFAICS.To get the program header, right. Then you need to find the ".note.gnu.build-id" section inside there.I am not saying it's impossible, as Simon pointed out, there is code in NaCl that does that already.But that doesn't look as simple as just printing a string (which is what version_info does).Hence my original question: why cannot we just use one of the existing versions/revisions?Maybe the answer is that we can't and we really need this, but would be nice to make sure that it is the case before introducing and exposing yet another GetVersion/BuildID/Revision() method.