https://sourceware.org/bugzilla/show_bug.cgi?id=26391
Bug ID: 26391 Summary: Question regarding duplicate symbols Product: binutils Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: kaccardi at gmail dot com Target Milestone: --- I am implementing "function granular kernel address space layout randomization" for Linux, and am trying to solve a problem that I am really hoping there is a compiler or linker option for. My implementation uses gcc's -ffunction-sections to break apart the kernel .text section by function. At kernel boot time, just after decompression, I shuffle all the function sections randomly and re-layout the kernel. Surprisingly, this works pretty well, but I am having a problem with a niche condition that is important to resolve for the live-patching use case. In order to live-patch the kernel, the live-patching code will request the address of symbols by name from the kernel. This works great after randomization because it always receives the current address at runtime rather than relying on any kind of buildtime address. The issue with with the live-patching code's algorithm for resolving duplicate symbol names. If they request a symbol by name from the kernel and there are 3 symbols with the same name, they use the symbol's position in the built binary image to select the correct symbol. This is obviously invalid when the layout has been shuffled randomly. I was hoping there was some kind of compiler or linker option that would add some kind of uniqueness to the symbols to make sure their were never any duplicates, but I am not finding such a thing. Is there something like this already available? Thanks very much! -- You are receiving this mail because: You are on the CC list for the bug.