{"action":"created","comment":{"url":"https://api.github.com/repos/slimbootloader/slimbootloader/pulls/comments/227979450","pull_request_review_id":168144143,"id":227979450,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNzk3OTQ1MA==","diff_hunk":"@@ -0,0 +1,228 @@\n+/** @file\n+\n+  Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\n+  This program and the accompanying materials\n+  are licensed and made available under the terms and conditions of the BSD License\n+  which accompanies this distribution.  The full text of the license may be found at\n+  http://opensource.org/licenses/bsd-license.php.\n+\n+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN \"AS IS\" BASIS,\n+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\n+\n+**/\n+\n+#include <Uefi/UefiBaseType.h>\n+#include <Library/BaseLib.h>\n+#include <Library/DebugLib.h>\n+#include <Library/BaseMemoryLib.h>\n+#include <Library/MemoryAllocationLib.h>\n+#include <Library/BootloaderCommonLib.h>\n+#include <Library/MultibootLib.h>\n+#include \"Elf32.h\"\n+\n+#define IS_BOOTABLE_I386_ELF(h) \\\n+ ( IS_ELF (h)                             && \\\n+  (h->E_Ident[EI_CLASS]   == ELFCLASS32)  && \\\n+  (h->E_Ident[EI_DATA]    == ELFDATA2LSB) && \\\n+  (h->E_Ident[EI_VERSION] == EV_CURRENT)  && \\\n+ ((h->E_Type              == ET_EXEC)     || (h->E_Type == ET_DYN)) && \\\n+  (h->E_Machine           == EM_386)      && \\\n+  (h->E_Version           == EV_CURRENT))\n+\n+/**\n+  Check if the image is a bootable ELF image.\n+\n+  @param[in]  ImageAddress      Memory address of an image\n+\n+  @retval     TRUE              Image is a bootable ELF image\n+  @retval     FALSE             Not a bootable ELF image\n+**/\n+BOOLEAN\n+EFIAPI\n+IsElfImage (\n+  IN  VOID  *ImageBase\n+  )\n+{\n+  ELF32_EHDR *Ehdr;\n+\n+  Ehdr = (ELF32_EHDR *) ImageBase;\n+\n+  return (BOOLEAN) IS_BOOTABLE_I386_ELF (Ehdr);\n+}\n+\n+/**\n+  load ELF image symbol table\n+\n+  @param[in]      ImageBase   Memory address of ELF image\n+  @param[in]      Ehdr        ELF file header\n+  @param[in,out]  Eaddr       Start address for ELF symbols\n+\n+  @retval         End address of loaded sysbols table\n+**/\n+UINT32\n+LoadElfSymtab (\n+  IN  VOID   *ImageBase,\n+  IN  UINT32  Eaddr\n+  )\n+{\n+  ELF32_EHDR                 *Ehdr;\n+  ELF32_SHDR                 *Shdr;\n+  UINT32                      Addr;\n+  UINT32                      Size;\n+  UINT32                      Index;\n+\n+  // Copy ELF section headers.\n+  Ehdr = (ELF32_EHDR *) (UINTN) ImageBase;\n+  if (Ehdr->E_Shnum == 0 || Ehdr->E_Shentsize) {\n+    return Eaddr;\n+  }\n+\n+  Shdr = (ELF32_SHDR *) (UINTN) Eaddr;\n+  Size = Ehdr->E_Shnum * Ehdr->E_Shentsize;\n+  CopyMem (Shdr, (VOID *) ((UINT32)ImageBase + Ehdr->E_Shoff), Size);\n+  Eaddr += Size;\n+\n+  // Copy sections that are part of the symbol table.\n+  for (Index = 0 ; Index < Ehdr->E_Shnum ; Index += 1) {\n+    if (Shdr[Index].Sh_Type != SHT_SYMTAB) {","path":"BootloaderCommonPkg/Library/ElfLib/ElfLib.c","position":87,"original_position":87,"commit_id":"5ad81e1853e32b716a2861ea4a4ad9370edcc3ba","original_commit_id":"5ad81e1853e32b716a2861ea4a4ad9370edcc3ba","user":{"login":"mauricema","id":11727697,"node_id":"MDQ6VXNlcjExNzI3Njk3","avatar_url":"https://avatars3.githubusercontent.com/u/11727697?v=4","gravatar_id":"","url":"https://api.github.com/users/mauricema","html_url":"https://github.com/mauricema","followers_url":"https://api.github.com/users/mauricema/followers","following_url":"https://api.github.com/users/mauricema/following{/other_user}","gists_url":"https://api.github.com/users/mauricema/gists{/gist_id}","starred_url":"https://api.github.com/users/mauricema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mauricema/subscriptions","organizations_url":"https://api.github.com/users/mauricema/orgs","repos_url":"https://api.github.com/users/mauricema/repos","events_url":"https://api.github.com/users/mauricema/events{/privacy}","received_events_url":"https://api.github.com/users/mauricema/received_events","type":"User","site_admin":false},"body":"dynamic symbols could potentially be used at RT for elf.   ","created_at":"2018-10-24T22:19:49Z","updated_at":"2018-10-24T22:19:49Z","html_url":"https://github.com/slimbootloader/slimbootloader/pull/23#discussion_r227979450","pull_request_url":"https://api.github.com/repos/slimbootloader/slimbootloader/pulls/23","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/slimbootloader/slimbootloader/pulls/comments/227979450"},"html":{"href":"https://github.com/slimbootloader/slimbootloader/pull/23#discussion_r227979450"},"pull_request":{"href":"https://api.github.com/repos/slimbootloader/slimbootloader/pulls/23"}},"in_reply_to_id":227924314},"pull_request":{"url":"https://api.github.com/repos/slimbootloader/slimbootloader/pulls/23","id":225495689,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1NDk1Njg5","html_url":"https://github.com/slimbootloader/slimbootloader/pull/23","diff_url":"https://github.com/slimbootloader/slimbootloader/pull/23.diff","patch_url":"https://github.com/slimbootloader/slimbootloader/pull/23.patch","issue_url":"https://api.github.com/repos/slimbootloader/slimbootloader/issues/23","number":23,"state":"open","locked":false,"title":"Support ELF format payload","user":{"login":"myguitar","id":11640135,"node_id":"MDQ6VXNlcjExNjQwMTM1","avatar_url":"https://avatars2.githubusercontent.com/u/11640135?v=4","gravatar_id":"","url":"https://api.github.com/users/myguitar","html_url":"https://github.com/myguitar","followers_url":"https://api.github.com/users/myguitar/followers","following_url":"https://api.github.com/users/myguitar/following{/other_user}","gists_url":"https://api.github.com/users/myguitar/gists{/gist_id}","starred_url":"https://api.github.com/users/myguitar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myguitar/subscriptions","organizations_url":"https://api.github.com/users/myguitar/orgs","repos_url":"https://api.github.com/users/myguitar/repos","events_url":"https://api.github.com/users/myguitar/events{/privacy}","received_events_url":"https://api.github.com/users/myguitar/received_events","type":"User","site_admin":false},"body":"In order to support ELF format payload in Stage2, ElfLib is\r\nseparated from MultibootLib.\r\n\r\nChange-Id: Iac45e8511101e2d12cb9a9f7f9bb2394a1e7be39\r\nSigned-off-by: Aiden Park <aiden.park@intel.com>","created_at":"2018-10-24T17:55:53Z","updated_at":"2018-10-24T22:19:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"70f9643de36dea5852b001a8b4989dddea7bf3b9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/slimbootloader/slimbootloader/pulls/23/commits","review_comments_url":"https://api.github.com/repos/slimbootloader/slimbootloader/pulls/23/comments","review_comment_url":"https://api.github.com/repos/slimbootloader/slimbootloader/pulls/comments{/number}","comments_url":"https://api.github.com/repos/slimbootloader/slimbootloader/issues/23/comments","statuses_url":"https://api.github.com/repos/slimbootloader/slimbootloader/statuses/5ad81e1853e32b716a2861ea4a4ad9370edcc3ba","head":{"label":"myguitar:dev_load_elf_payload","ref":"dev_load_elf_payload","sha":"5ad81e1853e32b716a2861ea4a4ad9370edcc3ba","user":{"login":"myguitar","id":11640135,"node_id":"MDQ6VXNlcjExNjQwMTM1","avatar_url":"https://avatars2.githubusercontent.com/u/11640135?v=4","gravatar_id":"","url":"https://api.github.com/users/myguitar","html_url":"https://github.com/myguitar","followers_url":"https://api.github.com/users/myguitar/followers","following_url":"https://api.github.com/users/myguitar/following{/other_user}","gists_url":"https://api.github.com/users/myguitar/gists{/gist_id}","starred_url":"https://api.github.com/users/myguitar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myguitar/subscriptions","organizations_url":"https://api.github.com/users/myguitar/orgs","repos_url":"https://api.github.com/users/myguitar/repos","events_url":"https://api.github.com/users/myguitar/events{/privacy}","received_events_url":"https://api.github.com/users/myguitar/received_events","type":"User","site_admin":false},"repo":{"id":151525113,"node_id":"MDEwOlJlcG9zaXRvcnkxNTE1MjUxMTM=","name":"slimbootloader","full_name":"myguitar/slimbootloader","private":false,"owner":{"login":"myguitar","id":11640135,"node_id":"MDQ6VXNlcjExNjQwMTM1","avatar_url":"https://avatars2.githubusercontent.com/u/11640135?v=4","gravatar_id":"","url":"https://api.github.com/users/myguitar","html_url":"https://github.com/myguitar","followers_url":"https://api.github.com/users/myguitar/followers","following_url":"https://api.github.com/users/myguitar/following{/other_user}","gists_url":"https://api.github.com/users/myguitar/gists{/gist_id}","starred_url":"https://api.github.com/users/myguitar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myguitar/subscriptions","organizations_url":"https://api.github.com/users/myguitar/orgs","repos_url":"https://api.github.com/users/myguitar/repos","events_url":"https://api.github.com/users/myguitar/events{/privacy}","received_events_url":"https://api.github.com/users/myguitar/received_events","type":"User","site_admin":false},"html_url":"https://github.com/myguitar/slimbootloader","description":"Visit http://slimbootloader.github.io for documentation","fork":true,"url":"https://api.github.com/repos/myguitar/slimbootloader","forks_url":"https://api.github.com/repos/myguitar/slimbootloader/forks","keys_url":"https://api.github.com/repos/myguitar/slimbootloader/keys{/key_id}","collaborators_url":"https://api.github.com/repos/myguitar/slimbootloader/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/myguitar/slimbootloader/teams","hooks_url":"https://api.github.com/repos/myguitar/slimbootloader/hooks","issue_events_url":"https://api.github.com/repos/myguitar/slimbootloader/issues/events{/number}","events_url":"https://api.github.com/repos/myguitar/slimbootloader/events","assignees_url":"https://api.github.com/repos/myguitar/slimbootloader/assignees{/user}","branches_url":"https://api.github.com/repos/myguitar/slimbootloader/branches{/branch}","tags_url":"https://api.github.com/repos/myguitar/slimbootloader/tags","blobs_url":"https://api.github.com/repos/myguitar/slimbootloader/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/myguitar/slimbootloader/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/myguitar/slimbootloader/git/refs{/sha}","trees_url":"https://api.github.com/repos/myguitar/slimbootloader/git/trees{/sha}","statuses_url":"https://api.github.com/repos/myguitar/slimbootloader/statuses/{sha}","languages_url":"https://api.github.com/repos/myguitar/slimbootloader/languages","stargazers_url":"https://api.github.com/repos/myguitar/slimbootloader/stargazers","contributors_url":"https://api.github.com/repos/myguitar/slimbootloader/contributors","subscribers_url":"https://api.github.com/repos/myguitar/slimbootloader/subscribers","subscription_url":"https://api.github.com/repos/myguitar/slimbootloader/subscription","commits_url":"https://api.github.com/repos/myguitar/slimbootloader/commits{/sha}","git_commits_url":"https://api.github.com/repos/myguitar/slimbootloader/git/commits{/sha}","comments_url":"https://api.github.com/repos/myguitar/slimbootloader/comments{/number}","issue_comment_url":"https://api.github.com/repos/myguitar/slimbootloader/issues/comments{/number}","contents_url":"https://api.github.com/repos/myguitar/slimbootloader/contents/{+path}","compare_url":"https://api.github.com/repos/myguitar/slimbootloader/compare/{base}...{head}","merges_url":"https://api.github.com/repos/myguitar/slimbootloader/merges","archive_url":"https://api.github.com/repos/myguitar/slimbootloader/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/myguitar/slimbootloader/downloads","issues_url":"https://api.github.com/repos/myguitar/slimbootloader/issues{/number}","pulls_url":"https://api.github.com/repos/myguitar/slimbootloader/pulls{/number}","milestones_url":"https://api.github.com/repos/myguitar/slimbootloader/milestones{/number}","notifications_url":"https://api.github.com/repos/myguitar/slimbootloader/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/myguitar/slimbootloader/labels{/name}","releases_url":"https://api.github.com/repos/myguitar/slimbootloader/releases{/id}","deployments_url":"https://api.github.com/repos/myguitar/slimbootloader/deployments","created_at":"2018-10-04T05:55:51Z","updated_at":"2018-10-17T16:37:54Z","pushed_at":"2018-10-24T17:48:15Z","git_url":"git://github.com/myguitar/slimbootloader.git","ssh_url":"git@github.com:myguitar/slimbootloader.git","clone_url":"https://github.com/myguitar/slimbootloader.git","svn_url":"https://github.com/myguitar/slimbootloader","homepage":"","size":5660,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause","node_id":"MDc6TGljZW5zZTQ="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"slimbootloader:master","ref":"master","sha":"97466fac835acab7648d2c143dabacaa3a534455","user":{"login":"slimbootloader","id":42816226,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQyODE2MjI2","avatar_url":"https://avatars0.githubusercontent.com/u/42816226?v=4","gravatar_id":"","url":"https://api.github.com/users/slimbootloader","html_url":"https://github.com/slimbootloader","followers_url":"https://api.github.com/users/slimbootloader/followers","following_url":"https://api.github.com/users/slimbootloader/following{/other_user}","gists_url":"https://api.github.com/users/slimbootloader/gists{/gist_id}","starred_url":"https://api.github.com/users/slimbootloader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slimbootloader/subscriptions","organizations_url":"https://api.github.com/users/slimbootloader/orgs","repos_url":"https://api.github.com/users/slimbootloader/repos","events_url":"https://api.github.com/users/slimbootloader/events{/privacy}","received_events_url":"https://api.github.com/users/slimbootloader/received_events","type":"Organization","site_admin":false},"repo":{"id":148708107,"node_id":"MDEwOlJlcG9zaXRvcnkxNDg3MDgxMDc=","name":"slimbootloader","full_name":"slimbootloader/slimbootloader","private":false,"owner":{"login":"slimbootloader","id":42816226,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQyODE2MjI2","avatar_url":"https://avatars0.githubusercontent.com/u/42816226?v=4","gravatar_id":"","url":"https://api.github.com/users/slimbootloader","html_url":"https://github.com/slimbootloader","followers_url":"https://api.github.com/users/slimbootloader/followers","following_url":"https://api.github.com/users/slimbootloader/following{/other_user}","gists_url":"https://api.github.com/users/slimbootloader/gists{/gist_id}","starred_url":"https://api.github.com/users/slimbootloader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slimbootloader/subscriptions","organizations_url":"https://api.github.com/users/slimbootloader/orgs","repos_url":"https://api.github.com/users/slimbootloader/repos","events_url":"https://api.github.com/users/slimbootloader/events{/privacy}","received_events_url":"https://api.github.com/users/slimbootloader/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/slimbootloader/slimbootloader","description":"Visit http://slimbootloader.github.io for documentation","fork":false,"url":"https://api.github.com/repos/slimbootloader/slimbootloader","forks_url":"https://api.github.com/repos/slimbootloader/slimbootloader/forks","keys_url":"https://api.github.com/repos/slimbootloader/slimbootloader/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slimbootloader/slimbootloader/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slimbootloader/slimbootloader/teams","hooks_url":"https://api.github.com/repos/slimbootloader/slimbootloader/hooks","issue_events_url":"https://api.github.com/repos/slimbootloader/slimbootloader/issues/events{/number}","events_url":"https://api.github.com/repos/slimbootloader/slimbootloader/events","assignees_url":"https://api.github.com/repos/slimbootloader/slimbootloader/assignees{/user}","branches_url":"https://api.github.com/repos/slimbootloader/slimbootloader/branches{/branch}","tags_url":"https://api.github.com/repos/slimbootloader/slimbootloader/tags","blobs_url":"https://api.github.com/repos/slimbootloader/slimbootloader/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slimbootloader/slimbootloader/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slimbootloader/slimbootloader/git/refs{/sha}","trees_url":"https://api.github.com/repos/slimbootloader/slimbootloader/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slimbootloader/slimbootloader/statuses/{sha}","languages_url":"https://api.github.com/repos/slimbootloader/slimbootloader/languages","stargazers_url":"https://api.github.com/repos/slimbootloader/slimbootloader/stargazers","contributors_url":"https://api.github.com/repos/slimbootloader/slimbootloader/contributors","subscribers_url":"https://api.github.com/repos/slimbootloader/slimbootloader/subscribers","subscription_url":"https://api.github.com/repos/slimbootloader/slimbootloader/subscription","commits_url":"https://api.github.com/repos/slimbootloader/slimbootloader/commits{/sha}","git_commits_url":"https://api.github.com/repos/slimbootloader/slimbootloader/git/commits{/sha}","comments_url":"https://api.github.com/repos/slimbootloader/slimbootloader/comments{/number}","issue_comment_url":"https://api.github.com/repos/slimbootloader/slimbootloader/issues/comments{/number}","contents_url":"https://api.github.com/repos/slimbootloader/slimbootloader/contents/{+path}","compare_url":"https://api.github.com/repos/slimbootloader/slimbootloader/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slimbootloader/slimbootloader/merges","archive_url":"https://api.github.com/repos/slimbootloader/slimbootloader/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slimbootloader/slimbootloader/downloads","issues_url":"https://api.github.com/repos/slimbootloader/slimbootloader/issues{/number}","pulls_url":"https://api.github.com/repos/slimbootloader/slimbootloader/pulls{/number}","milestones_url":"https://api.github.com/repos/slimbootloader/slimbootloader/milestones{/number}","notifications_url":"https://api.github.com/repos/slimbootloader/slimbootloader/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slimbootloader/slimbootloader/labels{/name}","releases_url":"https://api.github.com/repos/slimbootloader/slimbootloader/releases{/id}","deployments_url":"https://api.github.com/repos/slimbootloader/slimbootloader/deployments","created_at":"2018-09-13T23:07:33Z","updated_at":"2018-10-24T10:48:20Z","pushed_at":"2018-10-24T21:58:43Z","git_url":"git://github.com/slimbootloader/slimbootloader.git","ssh_url":"git@github.com:slimbootloader/slimbootloader.git","clone_url":"https://github.com/slimbootloader/slimbootloader.git","svn_url":"https://github.com/slimbootloader/slimbootloader","homepage":"","size":5648,"stargazers_count":91,"watchers_count":91,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause","node_id":"MDc6TGljZW5zZTQ="},"forks":26,"open_issues":2,"watchers":91,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/slimbootloader/slimbootloader/pulls/23"},"html":{"href":"https://github.com/slimbootloader/slimbootloader/pull/23"},"issue":{"href":"https://api.github.com/repos/slimbootloader/slimbootloader/issues/23"},"comments":{"href":"https://api.github.com/repos/slimbootloader/slimbootloader/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/slimbootloader/slimbootloader/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/slimbootloader/slimbootloader/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/slimbootloader/slimbootloader/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/slimbootloader/slimbootloader/statuses/5ad81e1853e32b716a2861ea4a4ad9370edcc3ba"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mauricema"}}