[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"ELF-Symbols" tag for relocatable images

From: Ahmed, Safayet (GE Global Research, US)
Subject: "ELF-Symbols" tag for relocatable images
Date: Fri, 17 Mar 2017 19:53:51 +0000

Hello again,

I had a question on the function, "grub_multiboot_load_elf(32/64)". 
(grub/grub_core/loader/multiboot_elfxx.c: line 54)

As a part of parsing an ELF image, the above-named function copies the section 
header table into memory, and copies "unloaded" sections into memory (lines 199 
- 269). The section table may be passed to an OS image as the "ELF-Symbols" tag 
of the multiboot2 information structure.

Section 2.6.7 of the specification states that "the physical address fields of 
the ELF section header then refer to where the sections are in memory".

Sections that are loaded are handled differently in the code from sections that 
are not loaded. This distinction is made at line  234. The loaded sections are 

The "sh_addr" field of entries in the table for not-loaded sections are 
explicitly updated to point to the address where those sections are copied 
(line 265). 

For "loaded" sections loaded to a fixed address, the "sh_addr" field of the 
section header table entries should be accurate without any updates. However, 
if the image is relocated, the "sh_addr" field of the entries for relocated 
sections are not necessarily accurate.

Is this a legitimate concern? Alternatively, should the section header table be 
absent from ELF images that contain the "relocatable tag" in the multiboot2 
header? Under normal circumstances, the section header table isn't really 
necessary for loading.

thank you,

Safayet N Ahmed Ph.D

Researcher, Computer Engineer
GE Global Research Center
One Research Circle,
Niskayuna, NY 12309  United States
General Electric Company, GE Global Research

GE imagination at work

reply via email to

[Prev in Thread] Current Thread [Next in Thread]