Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for bug table and data in .bss sections #133

Merged
merged 5 commits into from
Apr 22, 2014
Merged

Add support for bug table and data in .bss sections #133

merged 5 commits into from
Apr 22, 2014

Conversation

sjenning
Copy link
Contributor

No description provided.

Allow bundling of .bss.* sections that are the result of -fdata-sections
so that rela sections referencing data in bss sections by section symbol
can be replaced with the object symbol so it can be linked to the existing
data object in the kernel.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
The section header size is calculated at output time by libelf
and we use it as a read-only value from read files.

With the next patch we are changing the size of the .rela__bug_table
section.  Lets use d_size instead since it is the value that tells
libelf how to calculate sh_size at output time.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
This commit adds a new function to properly handle the bug table.
It works by going through .rela__bug_table, after the changed
function symbols have already been marked, and rewrites the section
including only the relocations pertaining to bug entries for
changed functions.

The __bug_table section itself is not modified resulting in
"blank" bug entries: ones whose IP and filename pointers will
not be relocated and, therefore, will be zero.  While a waste
of space, it simplifies the code not to remove these blank
entries. They do no harm.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
While debugging the code for the bug table logic, I found it useful to
know which rela section and entry the error occurred on.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
@sjenning
Copy link
Contributor Author

I haven't done a great deal of regression testing on this yet, but wanted to get the code out there for review (and backup) before I signed out for the evening.

@jpoimboe don't merge until I can run a few tests. I'll let you know.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
@sjenning
Copy link
Contributor Author

New commit addresses all comments thus far.

@sjenning
Copy link
Contributor Author

@jpoimboe I have done my testing and everything looks good. If it looks good to you, feel free to merge it.

jpoimboe added a commit that referenced this pull request Apr 22, 2014
Add support for bug table and data in .bss sections
@jpoimboe jpoimboe merged commit 2e60764 into dynup:master Apr 22, 2014
@sjenning sjenning deleted the bugtable branch May 27, 2014 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants